diff mbox series

scsi: aacraid: fix a signednes bug

Message ID 20180827092301.xtbunhvpl3ht2mjx@kili.mountain (mailing list archive)
State Accepted
Headers show
Series scsi: aacraid: fix a signednes bug | expand

Commit Message

Dan Carpenter Aug. 27, 2018, 9:23 a.m. UTC
The problem is that ->reset_state is a u8 but it can be set to -1 or -2
in aac_tmf_callback() and the error handling in aac_eh_target_reset()
relies on it to be signed.

Fixes: 0d643ff3c353 ("scsi: aacraid: use aac_tmf_callback for reset fib")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Martin K. Petersen Aug. 27, 2018, 5:02 p.m. UTC | #1
Dan,

> The problem is that ->reset_state is a u8 but it can be set to -1 or
> -2 in aac_tmf_callback() and the error handling in
> aac_eh_target_reset() relies on it to be signed.

Applied to 4.19/scsi-fixes, thank you!
diff mbox series

Patch

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 29bf1e60f542..39eb415987fc 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -1346,7 +1346,7 @@  struct fib {
 struct aac_hba_map_info {
 	__le32	rmw_nexus;		/* nexus for native HBA devices */
 	u8		devtype;	/* device type */
-	u8		reset_state;	/* 0 - no reset, 1..x - */
+	s8		reset_state;	/* 0 - no reset, 1..x - */
 					/* after xth TM LUN reset */
 	u16		qd_limit;
 	u32		scan_counter;