Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1465078

[PATCH 4/5] block-cciss: Move an assignment for the variable "sg_used" in cciss_bigpassthru()

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 4/5] block-cciss: Move an assignment for the variable "sg_used" in cciss_bigpassthru()
Date 2016-08-18 12:10 +0200
Message-ID <s7sqT-6Jo-51@gated-at.bofh.it> (permalink)
References <qEuGl-43C-5@gated-at.bofh.it> <s7shc-6qu-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 17 Aug 2016 23:04:46 +0200

Move the assignment for the local variable "sg_used" behind the source code
for some memory allocations by this function.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/block/cciss.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 10e1b0a..b08bfb7 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1575,7 +1575,7 @@ static int cciss_bigpassthru(ctlr_info_t *h, void __user *argp)
 	unsigned char **buff;
 	int *buff_size;
 	u64bit temp64;
-	BYTE sg_used = 0;
+	BYTE sg_used;
 	int status;
 	int i;
 	DECLARE_COMPLETION_ONSTACK(wait);
@@ -1616,6 +1616,7 @@ static int cciss_bigpassthru(ctlr_info_t *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.9.3

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/5] block-cciss: Fine-tuning for two function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-18 12:00 +0200
  [PATCH 1/5] block-cciss: Use memdup_user() rather than duplicating  its implementation SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-18 12:00 +0200
  [PATCH 2/5] block-cciss: Less function calls in cciss_bigpassthru()  after error detection SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-18 12:00 +0200
  [PATCH 3/5] block-cciss: Delete unnecessary initialisations in  cciss_bigpassthru() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-18 12:10 +0200
  [PATCH 4/5] block-cciss: Move an assignment for the variable  "sg_used" in cciss_bigpassthru() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-18 12:10 +0200
  [PATCH 5/5] block-cciss: Replace three kzalloc() calls by kcalloc() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-18 12:10 +0200

csiph-web