From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-scsi@vger.kernel.org, esc.storagedev@microsemi.com,
Don Brace <don.brace@microsemi.com>,
"James E. J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 4/4] scsi: hpsa: Move a variable assignment in hpsa_big_passthru_ioctl()
Date: Mon, 5 Mar 2018 09:34:36 +0100 [thread overview]
Message-ID: <b82cc1e8-bea0-c899-6a11-6b54732bdb6f@users.sourceforge.net> (raw)
In-Reply-To: <f013341a-e3b2-69a7-4918-8bb3d109f0cc@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 4 Mar 2018 22:16:05 +0100
Move an assignment for the local variable "sg_used" so that its setting
will only be performed after corresponding memory allocations succeeded
by this function.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/scsi/hpsa.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 86d371ab39e7..bb6df194ac31 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6380,7 +6380,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
unsigned char **buff;
int *buff_size;
u64 temp64;
- BYTE sg_used = 0;
+ BYTE sg_used;
int status;
u32 left;
u32 sz;
@@ -6420,6 +6420,7 @@ static int hpsa_big_passthru_ioctl(struct ctlr_info *h, void __user *argp)
}
left = ioc->buf_size;
data_ptr = ioc->buf;
+ sg_used = 0;
while (left) {
sz = (left > ioc->malloc_size) ? ioc->malloc_size : left;
buff_size[sg_used] = sz;
--
2.16.2
prev parent reply other threads:[~2018-03-05 8:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-05 8:30 [PATCH 0/4] SCSI-HPSA: Adjustments for hpsa_big_passthru_ioctl() SF Markus Elfring
2018-03-05 8:31 ` [PATCH 1/4] scsi: hpsa: Use memdup_user() rather than duplicating its implementation SF Markus Elfring
2018-03-05 8:32 ` [PATCH 2/4] scsi: hpsa: Less function calls in hpsa_big_passthru_ioctl() after error detection SF Markus Elfring
[not found] ` <1dc030776c924626b97594a18537f59c@microsemi.com>
2018-03-24 9:01 ` [2/4] " SF Markus Elfring
2018-03-05 8:33 ` [PATCH 3/4] scsi: hpsa: Delete an unnecessary initialisation in hpsa_big_passthru_ioctl() SF Markus Elfring
2018-03-05 8:34 ` SF Markus Elfring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b82cc1e8-bea0-c899-6a11-6b54732bdb6f@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=don.brace@microsemi.com \
--cc=esc.storagedev@microsemi.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).