Skip to contentSkip to conversation

mpt2sas: issue reset is not uninitialized

PATCH Superseded Dan Carpenter 3 participants 5 messages Dec 3, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mpt2sas: issue reset is not uninitialized

The issue_reset variables were never set to zero. This bug was found with static analysis.

drivers/scsi/mpt2sas/mpt2sas_base.c +2 -2
index 58e4521..98bd546 100644
@@ -3236,7 +3236,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = 0;
 	int rc;
 	void *request;
 	u16 wait_state_count;
@@ -3341,7 +3341,7 @@ mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = 0;
 	int rc;
 	void *request;
 	u16 wait_state_count;
#1 lore raw
Quoted 10 lines · Dan Carpenter

The issue_reset variables were never set to zero. This bug was found with static analysis.

drivers/scsi/mpt2sas/mpt2sas_base.c +0 -0
index 58e4521..98bd546 100644

drivers/scsi/mpt2sas/mpt2sas_base.c mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc, · line 3239

Quoted 5 lines
drivers/scsi/mpt2sas/mpt2sas_base.c +1 -1
@@ -3236,7 +3236,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = 0;

Why not false if it is going to be a boolean?

julia

Quoted 17 lines
drivers/scsi/mpt2sas/mpt2sas_base.c +1 -2
 	int rc;
 	void *request;
 	u16 wait_state_count;
@@ -3341,7 +3341,7 @@ mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = 0;
 	int rc;
 	void *request;
 	u16 wait_state_count;
--

To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 7 lines · Julia Lawall
Quoted 5 lines · Dan Carpenter

The issue_reset variables were never set to zero. This bug was found with static analysis.

Quoted 13 lines

drivers/scsi/mpt2sas/mpt2sas_base.c mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc, · line 3239

Quoted 10 lines
drivers/scsi/mpt2sas/mpt2sas_base.c +1 -1
index 58e4521..98bd546 100644
@@ -3236,7 +3236,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = 0;

Why not false if it is going to be a boolean?

Good point. I'll send a v2 for these tomorrow.

regards,
dan carpenter

#3 lore raw
In reply to Dan Carpenter

Am 03.12.2014 11:09, schrieb Dan Carpenter:

Quoted 19 lines

The issue_reset variables were never set to zero. This bug was found with static analysis.

drivers/scsi/mpt2sas/mpt2sas_base.c +1 -1
index 58e4521..98bd546 100644
@@ -3236,7 +3236,7 @@ mpt2sas_base_sas_iounit_control(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = 0;
 	int rc;
 	void *request;
 	u16 wait_state_count;

drivers/scsi/mpt2sas/mpt2sas_base.c mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc, · line 3347

Quoted 8 lines
drivers/scsi/mpt2sas/mpt2sas_base.c +1 -1
@@ -3341,7 +3341,7 @@ mpt2sas_base_scsi_enclosure_processor(struct MPT2SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = 0;
 	int rc;
 	void *request;
 	u16 wait_state_count;

hi Dan,
just a minor question:

did you forget to mention that you also changed from u8 to bool or was this unintentional ?

re,
wh

#4 lore raw
Quoted 5 lines · walter harms

hi Dan,
just a minor question:

did you forget to mention that you also changed from u8 to bool or was this unintentional ?

That's a trivial thing and I didn't think it was worth mentioning.

regards,
dan carpenter