diff mbox

scsi_dh_emc: return success in clariion_std_inquiry()

Message ID 20170221183050.GB28595@mwanda (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Dan Carpenter Feb. 21, 2017, 6:46 p.m. UTC
We accidentally return an uninitialized variable on success.

Fixes: b6ff1b14cdf4 ("[SCSI] scsi_dh: Update EMC handler")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Hannes Reinecke Feb. 22, 2017, 6:47 a.m. UTC | #1
On 02/21/2017 07:46 PM, Dan Carpenter wrote:
> We accidentally return an uninitialized variable on success.
> 
> Fixes: b6ff1b14cdf4 ("[SCSI] scsi_dh: Update EMC handler")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c
> index 4a7679f6c73d..f1578832ec7a 100644
> --- a/drivers/scsi/device_handler/scsi_dh_emc.c
> +++ b/drivers/scsi/device_handler/scsi_dh_emc.c
> @@ -358,7 +358,7 @@ static int clariion_prep_fn(struct scsi_device *sdev, struct request *req)
>  static int clariion_std_inquiry(struct scsi_device *sdev,
>  				struct clariion_dh_data *csdev)
>  {
> -	int err;
> +	int err = SCSI_DH_OK;
>  	char *sp_model;
>  
>  	sp_model = parse_sp_model(sdev, sdev->inquiry);
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Martin K. Petersen Feb. 23, 2017, 12:28 a.m. UTC | #2
>>>>> "Dan" == Dan Carpenter <dan.carpenter@oracle.com> writes:

Dan,

Dan> We accidentally return an uninitialized variable on success.

Applied to 4.11/scsi-fixes.

Thanks!
diff mbox

Patch

diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c
index 4a7679f6c73d..f1578832ec7a 100644
--- a/drivers/scsi/device_handler/scsi_dh_emc.c
+++ b/drivers/scsi/device_handler/scsi_dh_emc.c
@@ -358,7 +358,7 @@  static int clariion_prep_fn(struct scsi_device *sdev, struct request *req)
 static int clariion_std_inquiry(struct scsi_device *sdev,
 				struct clariion_dh_data *csdev)
 {
-	int err;
+	int err = SCSI_DH_OK;
 	char *sp_model;
 
 	sp_model = parse_sp_model(sdev, sdev->inquiry);