mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07: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:
committed by
Martin K. Petersen
parent
98f69975d4
commit
6ea68a8dc7
+1
-2
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user