linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] mpt3sas: issue_reset is uninitialized
@ 2014-12-03 10:09 Dan Carpenter
  2014-12-04 10:57 ` [patch v2] " Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2014-12-03 10:09 UTC (permalink / raw)
  To: Nagalakshmi Nandigama
  Cc: Praveen Krishnamoorthy, Sreekanth Reddy, Abhijit Mahajan,
	James E.J. Bottomley, MPT-FusionLinux.pdl, linux-scsi,
	kernel-janitors

We never set "issue_reset" to zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 1560115..a6d471a 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3419,7 +3419,7 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_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;
@@ -3523,7 +3523,7 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_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;

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [patch v2] mpt3sas: issue_reset is uninitialized
  2014-12-03 10:09 [patch] mpt3sas: issue_reset is uninitialized Dan Carpenter
@ 2014-12-04 10:57 ` Dan Carpenter
  2014-12-10  6:51   ` Sreekanth Reddy
  2014-12-30 12:56   ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2014-12-04 10:57 UTC (permalink / raw)
  To: Nagalakshmi Nandigama
  Cc: Praveen Krishnamoorthy, Sreekanth Reddy, Abhijit Mahajan,
	James E.J. Bottomley, MPT-FusionLinux.pdl, linux-scsi,
	kernel-janitors

The "issue_reset" can be used uninitialized.  It should be set to false
at the start.

Also I cleaned up the types a little by using bool.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
v2: style fix.  use true/false instead of 1/0.

diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
index 1560115..b9c2739 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_base.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
@@ -3419,7 +3419,7 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = false;
 	int rc;
 	void *request;
 	u16 wait_state_count;
@@ -3483,7 +3483,7 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
 		_debug_dump_mf(mpi_request,
 		    sizeof(Mpi2SasIoUnitControlRequest_t)/4);
 		if (!(ioc->base_cmds.status & MPT3_CMD_RESET))
-			issue_reset = 1;
+			issue_reset = true;
 		goto issue_host_reset;
 	}
 	if (ioc->base_cmds.status & MPT3_CMD_REPLY_VALID)
@@ -3523,7 +3523,7 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc,
 	u16 smid;
 	u32 ioc_state;
 	unsigned long timeleft;
-	u8 issue_reset;
+	bool issue_reset = false;
 	int rc;
 	void *request;
 	u16 wait_state_count;
@@ -3581,7 +3581,7 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc,
 		_debug_dump_mf(mpi_request,
 		    sizeof(Mpi2SepRequest_t)/4);
 		if (!(ioc->base_cmds.status & MPT3_CMD_RESET))
-			issue_reset = 1;
+			issue_reset = false;
 		goto issue_host_reset;
 	}
 	if (ioc->base_cmds.status & MPT3_CMD_REPLY_VALID)

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [patch v2] mpt3sas: issue_reset is uninitialized
  2014-12-04 10:57 ` [patch v2] " Dan Carpenter
@ 2014-12-10  6:51   ` Sreekanth Reddy
  2014-12-30 12:56   ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Sreekanth Reddy @ 2014-12-10  6:51 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Nagalakshmi Nandigama, Praveen Krishnamoorthy, Abhijit Mahajan,
	James E.J. Bottomley, MPT-FusionLinux.pdl, linux-scsi,
	kernel-janitors

This patch seems to be good. Please consider this patch as Acked-by:
"Sreekanth Reddy" <Sreekanth.Reddy@avagotech.com>

Regards,
Sreekanth

On Thu, Dec 4, 2014 at 4:27 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> The "issue_reset" can be used uninitialized.  It should be set to false
> at the start.
>
> Also I cleaned up the types a little by using bool.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> v2: style fix.  use true/false instead of 1/0.
>
> diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c
> index 1560115..b9c2739 100644
> --- a/drivers/scsi/mpt3sas/mpt3sas_base.c
> +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c
> @@ -3419,7 +3419,7 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
>         u16 smid;
>         u32 ioc_state;
>         unsigned long timeleft;
> -       u8 issue_reset;
> +       bool issue_reset = false;
>         int rc;
>         void *request;
>         u16 wait_state_count;
> @@ -3483,7 +3483,7 @@ mpt3sas_base_sas_iounit_control(struct MPT3SAS_ADAPTER *ioc,
>                 _debug_dump_mf(mpi_request,
>                     sizeof(Mpi2SasIoUnitControlRequest_t)/4);
>                 if (!(ioc->base_cmds.status & MPT3_CMD_RESET))
> -                       issue_reset = 1;
> +                       issue_reset = true;
>                 goto issue_host_reset;
>         }
>         if (ioc->base_cmds.status & MPT3_CMD_REPLY_VALID)
> @@ -3523,7 +3523,7 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc,
>         u16 smid;
>         u32 ioc_state;
>         unsigned long timeleft;
> -       u8 issue_reset;
> +       bool issue_reset = false;
>         int rc;
>         void *request;
>         u16 wait_state_count;
> @@ -3581,7 +3581,7 @@ mpt3sas_base_scsi_enclosure_processor(struct MPT3SAS_ADAPTER *ioc,
>                 _debug_dump_mf(mpi_request,
>                     sizeof(Mpi2SepRequest_t)/4);
>                 if (!(ioc->base_cmds.status & MPT3_CMD_RESET))
> -                       issue_reset = 1;
> +                       issue_reset = false;
>                 goto issue_host_reset;
>         }
>         if (ioc->base_cmds.status & MPT3_CMD_REPLY_VALID)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [patch v2] mpt3sas: issue_reset is uninitialized
  2014-12-04 10:57 ` [patch v2] " Dan Carpenter
  2014-12-10  6:51   ` Sreekanth Reddy
@ 2014-12-30 12:56   ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2014-12-30 12:56 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Nagalakshmi Nandigama, Praveen Krishnamoorthy, Sreekanth Reddy,
	Abhijit Mahajan, James E.J. Bottomley, MPT-FusionLinux.pdl,
	linux-scsi, kernel-janitors

Thanks,

applied to scsi-for-3.20.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-30 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-03 10:09 [patch] mpt3sas: issue_reset is uninitialized Dan Carpenter
2014-12-04 10:57 ` [patch v2] " Dan Carpenter
2014-12-10  6:51   ` Sreekanth Reddy
2014-12-30 12:56   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).