All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: mpt3sas: mpt3sas_transport.c:  Cleaning up uninitialized variables
@ 2014-06-01 13:08 Rickard Strandqvist
  2014-06-25  9:41 ` Sreekanth Reddy
  0 siblings, 1 reply; 3+ messages in thread
From: Rickard Strandqvist @ 2014-06-01 13:08 UTC (permalink / raw)
  To: Nagalakshmi Nandigama, Sreekanth Reddy
  Cc: Rickard Strandqvist, support, James E.J. Bottomley,
	DL-MPTFusionLinux, linux-scsi, linux-kernel

There is a risk that the variable will be used without being initialized.

This was largely found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/scsi/mpt3sas/mpt3sas_transport.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c
index 65170cb..f648dc4 100644
--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
@@ -305,8 +305,8 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc,
 	void *data_out = NULL;
 	dma_addr_t data_out_dma;
 	dma_addr_t data_in_dma;
-	size_t data_in_sz;
-	size_t data_out_sz;
+	size_t data_in_sz = sizeof(struct rep_manu_reply);
+	size_t data_out_sz = sizeof(struct rep_manu_request);
 	u16 wait_state_count;
 
 	if (ioc->shost_recovery || ioc->pci_error_recovery) {
@@ -357,8 +357,6 @@ _transport_expander_report_manufacture(struct MPT3SAS_ADAPTER *ioc,
 	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
 	ioc->transport_cmds.smid = smid;
 
-	data_out_sz = sizeof(struct rep_manu_request);
-	data_in_sz = sizeof(struct rep_manu_reply);
 	data_out = pci_alloc_consistent(ioc->pdev, data_out_sz + data_in_sz,
 	    &data_out_dma);
 
-- 
1.7.10.4


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

* RE: [PATCH] scsi: mpt3sas: mpt3sas_transport.c: Cleaning up uninitialized variables
  2014-06-01 13:08 [PATCH] scsi: mpt3sas: mpt3sas_transport.c: Cleaning up uninitialized variables Rickard Strandqvist
@ 2014-06-25  9:41 ` Sreekanth Reddy
  2014-06-25 11:33   ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Sreekanth Reddy @ 2014-06-25  9:41 UTC (permalink / raw)
  To: Rickard Strandqvist, Nagalakshmi Nandigama, Sreekanth Reddy,
	James Bottomley
  Cc: linux-kernel, Martin K. Petersen, Christoph Hellwig

Hi James,

This Patch seem to be fine. Please consider this patch as Acked-by:
Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>

Regards,
Sreekanth

>-----Original Message-----
>From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
>owner@vger.kernel.org] On Behalf Of Rickard Strandqvist
>Sent: Sunday, June 01, 2014 6:39 PM
>To: Nagalakshmi Nandigama; Sreekanth Reddy
>Cc: Rickard Strandqvist; support@lsi.com; James E.J. Bottomley; DL-
>MPTFusionLinux@lsi.com; linux-scsi@vger.kernel.org; linux-
>kernel@vger.kernel.org
>Subject: [PATCH] scsi: mpt3sas: mpt3sas_transport.c: Cleaning up
uninitialized
>variables
>
>There is a risk that the variable will be used without being initialized.
>
>This was largely found by using a static code analysis program called
cppcheck.
>
>Signed-off-by: Rickard Strandqvist
<rickard_strandqvist@spectrumdigital.se>
>---
> drivers/scsi/mpt3sas/mpt3sas_transport.c |    6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c
>b/drivers/scsi/mpt3sas/mpt3sas_transport.c
>index 65170cb..f648dc4 100644
>--- a/drivers/scsi/mpt3sas/mpt3sas_transport.c
>+++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c
>@@ -305,8 +305,8 @@ _transport_expander_report_manufacture(struct
>MPT3SAS_ADAPTER *ioc,
> 	void *data_out = NULL;
> 	dma_addr_t data_out_dma;
> 	dma_addr_t data_in_dma;
>-	size_t data_in_sz;
>-	size_t data_out_sz;
>+	size_t data_in_sz = sizeof(struct rep_manu_reply);
>+	size_t data_out_sz = sizeof(struct rep_manu_request);
> 	u16 wait_state_count;
>
> 	if (ioc->shost_recovery || ioc->pci_error_recovery) { @@ -357,8
>+357,6 @@ _transport_expander_report_manufacture(struct
>MPT3SAS_ADAPTER *ioc,
> 	mpi_request = mpt3sas_base_get_msg_frame(ioc, smid);
> 	ioc->transport_cmds.smid = smid;
>
>-	data_out_sz = sizeof(struct rep_manu_request);
>-	data_in_sz = sizeof(struct rep_manu_reply);
> 	data_out = pci_alloc_consistent(ioc->pdev, data_out_sz +
data_in_sz,
> 	    &data_out_dma);
>
>--
>1.7.10.4
>
>--
>To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body
>of a message to majordomo@vger.kernel.org More majordomo info at
>http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH] scsi: mpt3sas: mpt3sas_transport.c: Cleaning up uninitialized variables
  2014-06-25  9:41 ` Sreekanth Reddy
@ 2014-06-25 11:33   ` Christoph Hellwig
  0 siblings, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2014-06-25 11:33 UTC (permalink / raw)
  To: Sreekanth Reddy
  Cc: Rickard Strandqvist, Nagalakshmi Nandigama, Sreekanth Reddy,
	James Bottomley, linux-kernel, Martin K. Petersen,
	Christoph Hellwig

On Wed, Jun 25, 2014 at 03:11:42PM +0530, Sreekanth Reddy wrote:
> Hi James,
> 
> This Patch seem to be fine. Please consider this patch as Acked-by:
> Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>

I can't really find this in any of my mailboxes.  Can you just resend it
with your next driver update?  Thanks!


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

end of thread, other threads:[~2014-06-25 11:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-01 13:08 [PATCH] scsi: mpt3sas: mpt3sas_transport.c: Cleaning up uninitialized variables Rickard Strandqvist
2014-06-25  9:41 ` Sreekanth Reddy
2014-06-25 11:33   ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.