Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965305AbcCNObI (ORCPT ); Mon, 14 Mar 2016 10:31:08 -0400 Received: from mout.kundenserver.de ([212.227.17.24]:57679 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965276AbcCNObD (ORCPT ); Mon, 14 Mar 2016 10:31:03 -0400 From: Arnd Bergmann To: martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, Kashyap Desai , Sumit Saxena , Uday Lingala , "James E.J. Bottomley" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Tomas Henzl , Bjorn Helgaas , megaraidlinux.pdl@avagotech.com Subject: [PATCH 3/3] megaraid_sas: add missing curly braces in ioctl handler Date: Mon, 14 Mar 2016 15:29:45 +0100 Message-Id: <1457965789-3373916-4-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457965789-3373916-1-git-send-email-arnd@arndb.de> References: <1457965789-3373916-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:mOSVU53TaEHHMn7cZyVYcuHFH9mqpdImWdLZ75VNAPkGsVD+/kU kkad9WBUseJhbymsuW6qkGz5R0lhJdn0tm+dPBzcl3TsGdD4m3cW3Sp6WmhLXO7AaFiLksc stsVPYHWM5dkxpu93vL7+Ja3YoHKY7mipizjf6VhpE2Lezc5ddrleCJT6heDki0QznSW+Fi ku11ltkcxhxdBJKnpDzsQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:LtE6+u9lox8=:6qb15QMVPkLDTNfPYLy3Ki VFQEn635tYtKdBGXugiCXpCe81gvV6NtxuvD8hX08tA+chfoSI5cmSJSEsyU41wkub8LOV2MK Gtn7yXi/oV4p+8SpRQXktoSR0DiHEns3dKM2BSH7ogTBVwz24KLXzdX5KyOFPWda2cPnRHKv1 9A4MW1Q8uRGJzds2ZbusHPQFHuYPeMWzWP9UnDDNjFod3YRyRVx2NVPfq11RYAjRzTjQgkuEk 4AOEgrMweSc6YBpfh8WMj6BgOvN3WkPlnWYnwsjS9u6JiQRpG0mcY+KSuCpeF2LI4umJynkDc bHHYX4i4TxCn+eiwYXNtMqCRo9bbKQTR5h+uBwEpc+FsQ/sMVmprBcdzcb0CyKJX+YQjl7MUC rI07XSzkwVhedXkUqtyRINxai+6s0OPymu2XKgqzAzPeaxydVE9zJMeIV1e/wxKjNXYdAOduo ha7zuhqB4PSIj9PLzNJxk87dbJ5K9+vfJC9gX24Dz0M4CmSphVqcTOV+KV9s3b0kgs8J1KsK5 AjofwJSqdAJExRrCp18/+Xmf0JcSjue84MAZhNnL5oLC/ur5qOhLihDWMbt9s9Y3B5+qRnKxB smvtWUeXG77B0vKZ3p8dOGaWVZanh21GCXdZYCcfJgcz465HeIYbSK9c5kj9KF+r3+0qUMOO6 f3f2+1BbfnyS7PUzhhj5pOrmy4gO3WWDn/Bzkxe1Jp2i2diagwkgWIWtKjCZpLYK+sAI= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1432 Lines: 44 gcc-6 found a dubious indentation in the megasas_mgmt_fw_ioctl function: drivers/scsi/megaraid/megaraid_sas_base.c: In function 'megasas_mgmt_fw_ioctl': drivers/scsi/megaraid/megaraid_sas_base.c:6658:4: warning: statement is indented as if it were guarded by... [-Wmisleading-indentation] kbuff_arr[i] = NULL; ^~~~~~~~~ drivers/scsi/megaraid/megaraid_sas_base.c:6653:3: note: ...this 'if' clause, but it is not if (kbuff_arr[i]) ^~ The code is actually correct, as there is no downside in clearing a NULL pointer again. This clarifies the code and avoids the warning by adding extra curly braces. Signed-off-by: Arnd Bergmann Fixes: 90dc9d98f01b ("megaraid_sas : MFI MPT linked list corruption fix") --- drivers/scsi/megaraid/megaraid_sas_base.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 5c08568ccfbf..2627200d4f82 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -6650,12 +6650,13 @@ out: } for (i = 0; i < ioc->sge_count; i++) { - if (kbuff_arr[i]) + if (kbuff_arr[i]) { dma_free_coherent(&instance->pdev->dev, le32_to_cpu(kern_sge32[i].length), kbuff_arr[i], le32_to_cpu(kern_sge32[i].phys_addr)); kbuff_arr[i] = NULL; + } } megasas_return_cmd(instance, cmd); -- 2.7.0