From patchwork Thu Aug 18 10:02:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9287223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C1FEF60574 for ; Thu, 18 Aug 2016 10:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2D4128FC6 for ; Thu, 18 Aug 2016 10:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A72F628FCB; Thu, 18 Aug 2016 10:09:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5783F28FC6 for ; Thu, 18 Aug 2016 10:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753905AbcHRKJ1 (ORCPT ); Thu, 18 Aug 2016 06:09:27 -0400 Received: from mout.web.de ([212.227.15.14]:56496 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753569AbcHRKJC (ORCPT ); Thu, 18 Aug 2016 06:09:02 -0400 Received: from [192.168.1.3] ([77.182.223.38]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MUir6-1bfwrl1TGm-00YDsO; Thu, 18 Aug 2016 12:02:17 +0200 Subject: [PATCH 4/5] block-cciss: Move an assignment for the variable "sg_used" in cciss_bigpassthru() To: esc.storagedev@microsemi.com, iss_storagedev@hp.com, linux-scsi@vger.kernel.org, Don Brace References: <566ABCD9.1060404@users.sourceforge.net> <686a1f95-a76c-2624-50e1-9d0e59948e64@users.sourceforge.net> Cc: LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring Message-ID: <5a957717-4d29-55e1-87a5-c8c9c701ea03@users.sourceforge.net> Date: Thu, 18 Aug 2016 12:02:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <686a1f95-a76c-2624-50e1-9d0e59948e64@users.sourceforge.net> X-Provags-ID: V03:K0:Q94XKIxRI6nmiVJqc3JXR3yDIeK4Xx1dPeAYXz4CI4pO8vM2e0M 1EzekeNNnXbgHVO62Qaus+nHFm3VlApCxZUtFYhJ0rTnK6pBxedGfgbca2GXpxctJVfcAW2 TIQsrgbMhji0T2q+cqX0W6pCQ8dD28gJSWKbwOLPRKPYh5h9wdIsUeAlmlerCLDv0SaWG44 t+Xt7V1vouYkIqVNpfIGg== X-UI-Out-Filterresults: notjunk:1; V01:K0:5PUd1lrp9EY=:YnjYgX/4yEcpwu0oGDNBzp uWceOeTOBnPujt5Jkypf1XTfA8L4gO9kBTu1jmOHg8zHkKcGt4KrGBh0tGVM5izek2AyLOYSu P+hbriBxE61pq+td16Qq1dDDhKJhOfZ05PlRx7LzBLvxKbvnL0iQWqW7Et0M5Bsgx+m+THkNh uldT88BDoOqcJ9V1PYpFc96D45FSGa8SAQXauiyRXg0P4rhGUTrvrK+HWk8/tfpwnPBM1uJ+x 1B8eBN8nlD+hGqQNvBDq5VT6TSEHJTfGGNjJjHnSLJ3vNi5EZMao5YzUWGcse8vhGaTE0eqS2 217vYTuwhtyey/mmRa9dalQCuqd88SEEFjQeeQn4pPVyBka473A7VelOzxlihJNi+bN4K5dvz Z3YsJacZr61Uamp1/9r5e/Cz2a0BD93o6gprYUIy5v7FLp7ZQuoSClm6od8MvYRzmU4zXgS6D Vx4dOFAHXpZTGn5VwETYEagtQJmJN+wyj6dYet907+BFLUAkKhod4n2299F0GL9xNlboxALpl eOqiefQdmMHak+aMRkF9gXsirDF0F86uIXETuJKLJhBrthrXZtorCC4jumAfkEEWKiLDBIgD3 bCqgGMn95Bdd5tUTCt+yL7NPmNo7vgTwYUJcXbKgua3H/O2gC48jxNY3x1t4+7GjWJuljEslc FNljKJB6FURKfW9mt88zeQ6kajgmEAPHMRDVq4dQlnItWOi9dbxCpVU+U494R60ABHUNtrKz7 Q2agPuJhtE9mv93EN6oDUgAo2Uw3jo/LV2SlAnPhABhupJDiO6oZ51JB2tjXbvBICQqBpd4eB 69OcWq2 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring 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 --- 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;