mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
scsi: sd: Fix return code handling in sd_spinup_disk()
As found by smatch-ci, scsi_execute_cmd() can return negative or positve
values so we should use a int instead of unsigned int.
Fixes: b4d0c33a32 ("scsi: sd: Fix sshdr use in sd_spinup_disk")
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/linux-scsi/agFbI7E6JQwd3wGW@stanley.mountain/T/#u
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260511175317.114007-1-michael.christie@oracle.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
98f69975d4
commit
6ea68a8dc7
|
|
@ -2476,8 +2476,7 @@ sd_spinup_disk(struct scsi_disk *sdkp)
|
|||
{
|
||||
static const u8 cmd[10] = { TEST_UNIT_READY };
|
||||
unsigned long spintime_expire = 0;
|
||||
int spintime, sense_valid = 0;
|
||||
unsigned int the_result;
|
||||
int the_result, spintime, sense_valid = 0;
|
||||
struct scsi_sense_hdr sshdr;
|
||||
struct scsi_failure failure_defs[] = {
|
||||
/* Do not retry Medium Not Present */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user