[PATCH] scsi: fix potential NULL pointer dereference.

2014-03-25 Thread Maurizio Lombardi
The scsi_get_command() function returns NULL if it fails to allocate the scsi_cmnd structure. If this happens, a NULL pointer will be dereferenced. Signed-off-by: Maurizio Lombardi mlomb...@redhat.com --- drivers/scsi/scsi_error.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

Re: [PATCH] scsi: fix potential NULL pointer dereference.

2014-03-25 Thread Christoph Hellwig
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 78b004d..4021849 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2289,6 +2289,9 @@ scsi_reset_provider(struct scsi_device *dev, int flag) return FAILED; scmd =

Re: [PATCH] scsi: fix potential NULL pointer dereference.

2014-03-25 Thread Maurizio Lombardi
On Tue, Mar 25, 2014 at 06:13:06AM -0700, Christoph Hellwig wrote: diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 78b004d..4021849 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -2289,6 +2289,9 @@ scsi_reset_provider(struct scsi_device

Re: [PATCH] scsi: fix potential NULL pointer dereference.

2014-03-25 Thread Christoph Hellwig
On Tue, Mar 25, 2014 at 02:30:46PM +0100, Maurizio Lombardi wrote: Yes you are right, it should call scsi_autopm_put_host before returning. So if you already have a correct version for it then I drop this patch. This was the version I sent out: