Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Christophe JAILLET
Le 13/04/2017 à 18:13, Dan Carpenter a écrit : On Thu, Apr 13, 2017 at 08:37:50PM +0530, Harsh Jain wrote: On Thu, Apr 13, 2017 at 8:20 PM, Christophe JAILLET wrote: Le 13/04/2017 à 16:04, Dan Carpenter a écrit : On Thu, Apr 13, 2017 at 02:14:30PM +0200,

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Dan Carpenter
On Thu, Apr 13, 2017 at 08:37:50PM +0530, Harsh Jain wrote: > On Thu, Apr 13, 2017 at 8:20 PM, Christophe JAILLET > wrote: > > Le 13/04/2017 à 16:04, Dan Carpenter a écrit : > >> > >> On Thu, Apr 13, 2017 at 02:14:30PM +0200, Christophe JAILLET wrote: > >>> > >>> If

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Harsh Jain
On Thu, Apr 13, 2017 at 8:20 PM, Christophe JAILLET wrote: > Le 13/04/2017 à 16:04, Dan Carpenter a écrit : >> >> On Thu, Apr 13, 2017 at 02:14:30PM +0200, Christophe JAILLET wrote: >>> >>> If 'chcr_alloc_shash()' a few lines above fails, 'base_hash' can be an >>>

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Christophe JAILLET
Le 13/04/2017 à 16:04, Dan Carpenter a écrit : On Thu, Apr 13, 2017 at 02:14:30PM +0200, Christophe JAILLET wrote: If 'chcr_alloc_shash()' a few lines above fails, 'base_hash' can be an error pointer when we 'goto out'. So checking for NULL here is not enough because it is likely that

Re: [PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Dan Carpenter
On Thu, Apr 13, 2017 at 02:14:30PM +0200, Christophe JAILLET wrote: > If 'chcr_alloc_shash()' a few lines above fails, 'base_hash' can be an > error pointer when we 'goto out'. > So checking for NULL here is not enough because it is likely that > 'chcr_free_shash' will crash if we pass an error

[PATCH 2/2] crypto: chcr - Fix error checking

2017-04-13 Thread Christophe JAILLET
If 'chcr_alloc_shash()' a few lines above fails, 'base_hash' can be an error pointer when we 'goto out'. So checking for NULL here is not enough because it is likely that 'chcr_free_shash' will crash if we pass an error pointer. Signed-off-by: Christophe JAILLET