Re: [PATCH] Fix uninitialized variable error in scsi_io_completion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alan Stern wrote:
> This patch (as1191) adds a missing "default" case in
> scsi_io_completion(), thereby fixing an "uninitialized variable"
> error.  It also adds a missing newline to a log entry.
> 
> Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> 
> ---
> 
> James, I'm shocked!  :-)   Didn't you ever try to compile your changes 
> to this routine?
> 
> Alan Stern
> 
> 
> 
> Index: usb-2.6/drivers/scsi/scsi_lib.c
> ===================================================================
> --- usb-2.6.orig/drivers/scsi/scsi_lib.c
> +++ usb-2.6/drivers/scsi/scsi_lib.c
> @@ -1024,6 +1024,10 @@ void scsi_io_completion(struct scsi_cmnd
>  				case 0x09: /* self test in progress */
>  					action = ACTION_DELAYED_RETRY;
>  					break;
> +				default:
> +					description = "Device not ready";
> +					action = ACTION_FAIL;
> +					break;
>  				}
>  			} else {
>  				description = "Device not ready";
> @@ -1049,7 +1053,7 @@ void scsi_io_completion(struct scsi_cmnd
>  		/* Give up and fail the remainder of the request */
>  		if (!(req->cmd_flags & REQ_QUIET)) {
>  			if (description)
> -				scmd_printk(KERN_INFO, cmd, "%s",
> +				scmd_printk(KERN_INFO, cmd, "%s\n",
>  					    description);
>  			scsi_print_result(cmd);
>  			if (driver_byte(result) & DRIVER_SENSE)
> 
> --

Good catch, I saw the warning but failed to see the missing case.
I attributed it to my brain dead gcc version.

Boaz
 
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux