From patchwork Wed Nov 9 12:55:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101544 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp179360qge; Wed, 9 Nov 2016 04:57:37 -0800 (PST) X-Received: by 10.98.75.11 with SMTP id y11mr32909480pfa.30.1478696257359; Wed, 09 Nov 2016 04:57:37 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n28si42034699pgd.281.2016.11.09.04.57.37; Wed, 09 Nov 2016 04:57:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753885AbcKIM5Z (ORCPT + 27 others); Wed, 9 Nov 2016 07:57:25 -0500 Received: from mout.kundenserver.de ([212.227.126.131]:49850 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753797AbcKIM5W (ORCPT ); Wed, 9 Nov 2016 07:57:22 -0500 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0Lq1ku-1ciAsp3Ubw-00djZw; Wed, 09 Nov 2016 13:55:59 +0100 From: Arnd Bergmann To: Jens Axboe Cc: Christoph Hellwig , Arnd Bergmann , Mike Christie , Hannes Reinecke , Ming Lin , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] skd: fix msix error handling Date: Wed, 9 Nov 2016 13:55:34 +0100 Message-Id: <20161109125555.1440353-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:SK9WgnAmhwsipKGX9zRjj5hvqL3fy6AnfSzKn4p80auKcP4pPV4 +HaA0BcccM740RxMQmTavZjsMhVsxd2FO6MbhYejKvWJDEKfm+4O9a8zx9GeWlZOWs7sUH3 S8F9m9P9hM9bhqKOFa5D1MR6NLm/FFfNDn0ozgvtFE64fzqNA1l6pY8161NijLXo+gMlvtV HB9NkIhUJ9Mf0AsFBqrNg== X-UI-Out-Filterresults: notjunk:1; V01:K0:u9oeYotezaA=:s42flFuY8dcnpCEPWWJTW7 myLVjNjyRYRJTHEoMpWN0kqaJiXx//6AOfiSFI4YhVu/F2ss1rkjwhxEnt0LQRKJBEaqQtl+r lUjB1FX2nqpxcUMVWvrKBf5K4gEsxySv2GIWtuSJ0JcYa7F2IEsOrXlxBRkqRqJxeHk/VM0Br usGP6DqOXGlEiA5lY3kkdAvQvVwUioi0nll84l7cM0YOR5l01p1e3GSD9pdjdykWESTw9X830 21UyrZ30WFeqfAy4NSzLeVGOVNqEBKa6hwV4H+YL3hIzFu5LO2c9I5Dt1TfISH7MlwaSy5o/R rVQN5HWODoFBXL4c0r3ltdCx/lBQa1gk7sPT/TZ02GkRx8qMJETwj23SrYn5jRPNxd55M1ES1 bpuQYyC8KH3e9xpUqzoxhwYSNpeg8RcWgPomSskoU54FfnUm5CT/D9ni6JAVrG/sk36qdM8+V sUNiiMfXAipGxBPWBpENJkEZnn04oi/NcxPT1nHlQ4ocPbWGLmRsG1lCNC9XnAxzP3Ffzq095 YKxHJTS+YZigm7GJfhFXZYvusCX+U3qsyCjKUDWDr7vOj3j8A3u3ALydY0Z7ru4s3ZjAx7caQ MkUB/IVWS+EXamVmr3WXfKrlIUVcfYXws806o2FYDewuwMkGCCzCuaE13NvStI18/TsgoIroU /JaInOj/39S0UR+RwaBdstkiv72Pw7HsB6URu8nzH1L15+bLVZWpCKtoF2sREjM1UnTUJUg1G /45IgX8+PFgPEmKN Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As reported by gcc -Wmaybe-uninitialized, the cleanup path for skd_acquire_msix tries to free the already allocated msi-x vectors in reverse order, but the index variable may not have been used yet: drivers/block/skd_main.c: In function ‘skd_acquire_irq’: drivers/block/skd_main.c:3890:8: error: ‘i’ may be used uninitialized in this function [-Werror=maybe-uninitialized] This changes the failure path to skip releasing the interrupts if we have not started requesting them yet. Fixes: 180b0ae77d49 ("skd: use pci_alloc_irq_vectors") Signed-off-by: Arnd Bergmann --- drivers/block/skd_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index a58256cd94d7..66146b349229 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -3849,7 +3849,7 @@ static int skd_acquire_msix(struct skd_device *skdev) if (rc < 0) { pr_err("(%s): failed to enable MSI-X %d\n", skd_name(skdev), rc); - goto msix_out; + goto out; } skdev->msix_entries = kcalloc(SKD_MAX_MSIX_COUNT, @@ -3858,7 +3858,7 @@ static int skd_acquire_msix(struct skd_device *skdev) rc = -ENOMEM; pr_err("(%s): msix table allocation error\n", skd_name(skdev)); - goto msix_out; + goto out; } /* Enable MSI-X vectors for the base queue */ @@ -3889,6 +3889,7 @@ static int skd_acquire_msix(struct skd_device *skdev) msix_out: while (--i >= 0) devm_free_irq(&pdev->dev, pci_irq_vector(pdev, i), skdev); +out: kfree(skdev->msix_entries); skdev->msix_entries = NULL; return rc; From patchwork Wed Nov 9 12:55:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101545 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp179256qge; Wed, 9 Nov 2016 04:57:22 -0800 (PST) X-Received: by 10.98.90.135 with SMTP id o129mr33240319pfb.81.1478696242104; Wed, 09 Nov 2016 04:57:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c16si8298873pae.331.2016.11.09.04.57.21; Wed, 09 Nov 2016 04:57:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753736AbcKIM5R (ORCPT + 27 others); Wed, 9 Nov 2016 07:57:17 -0500 Received: from mout.kundenserver.de ([212.227.126.130]:54090 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196AbcKIM5O (ORCPT ); Wed, 9 Nov 2016 07:57:14 -0500 Received: from wuerfel.lan. ([78.43.20.153]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0LpTGA-1ciivj3IMI-00fOH0; Wed, 09 Nov 2016 13:57:01 +0100 From: Arnd Bergmann To: Jens Axboe Cc: Christoph Hellwig , Arnd Bergmann , Johannes Thumshirn , Ming Lin , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] skd: fix function prototype Date: Wed, 9 Nov 2016 13:55:35 +0100 Message-Id: <20161109125555.1440353-2-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20161109125555.1440353-1-arnd@arndb.de> References: <20161109125555.1440353-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K0:Oa4U0jUQoaNTNA0LEFP8YGv1/G28nod8TBplSc+K6WBjByM9gyk Rv2/4XUyOpByQ+ChI9SpCECtuFBZlBKBJ/Xi3hiYKkeQRAo8MWNzKRN21UADyMUitGlyiS9 3qWeAgcoCJwfXZUzRngJ971hZ4zNZDfxLn9Vu+I3vd4CjGxLBnv7M+mVnEykyTIWANE1U6E ZBH6iD5QR55l9V7pkcjdg== X-UI-Out-Filterresults: notjunk:1; V01:K0:dVipz7jxQ+s=:jeinGuBlTLmwXncwe95pC/ 85owF5c1TGiMWdxBlxFXKQkCxFnjFxI4ep/FLAP7UArXy8d4cNEjSkN9haR8ZSiMr7lHyQriT XUVSm+1ZVCumecGauKiBzuSxd8RtwW0FfpmPFTBwvOf0pyjpCyVcinY+YIFQo3LUpuoIEWzTw 32KNSRWQs/iMjRCe5yzIVj4OVq9osTThY4EM/ivOMlnu7D+T8GGT3SfBK62LxQKYsPOSL1Wgo sO8G9yIAYLqGVKlkV2tfBdRKhEMh6qK3W5DlbofNyF/FShiRJ3/vPhyvtntR0l8V9IAJtIxI1 F9w+kvqGNcFW2GGtSfE/p+dX+CSr9u1NkfvSmtnF3/dvHYfwR41YLMGZpnrTKXNR82nysDER5 I+wMaP0h4CQo0qeKytJ7fj6llHTKE2379stADS5+q54w+GeNeH3dubKu/UHxEmnTTZRA5ZfW0 VIxU/EljPNG8QnJbm70+BbJf7+/+PZjmwBFgt6niWYEia53cINr7KZCKMjdGpxmVxu/Ls8J1J k9bFGL1TfgWDhRTVOia3tOp3iJVmclIM11gvUUDVYqu3sTv37QDSjNCO25e/pJKaeFJCyW8W4 ThoCGGsKC152W885uFCEM1/2DwbBdEyc/qVK8NXzrtAtp/rmVMnsS99hjtawFxsGVo01zNlIx tjsGQgtQtLZM3CQcygkGJQu1Y6xoHAbyLXx9hvWZ1jVdIi+hXCQKAVvo6kB5b8UPRqouVUINx DsA36yUkcrplEeW1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Building with W=1 shows a harmless warning for the skd driver: drivers/block/skd_main.c:2959:1: error: ‘static’ is not at beginning of declaration [-Werror=old-style-declaration] This changes the prototype to the expected formatting. Signed-off-by: Arnd Bergmann --- drivers/block/skd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.9.0 diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c index 66146b349229..1e536b97f802 100644 --- a/drivers/block/skd_main.c +++ b/drivers/block/skd_main.c @@ -2945,8 +2945,8 @@ static void skd_completion_worker(struct work_struct *work) static void skd_isr_msg_from_dev(struct skd_device *skdev); -irqreturn_t -static skd_isr(int irq, void *ptr) +static irqreturn_t +skd_isr(int irq, void *ptr) { struct skd_device *skdev; u32 intstat;