From patchwork Mon Aug 3 15:00:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 6930181 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4F702C05AC for ; Mon, 3 Aug 2015 15:01:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5EE1C20614 for ; Mon, 3 Aug 2015 15:01:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2AB3020624 for ; Mon, 3 Aug 2015 15:01:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753873AbbHCPBD (ORCPT ); Mon, 3 Aug 2015 11:01:03 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:38533 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753585AbbHCPA7 (ORCPT ); Mon, 3 Aug 2015 11:00:59 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1ZMHEV-0004pJ-9o; Mon, 03 Aug 2015 15:00:55 +0000 From: Colin King To: Kashyap Desai , Sumit Saxena , Uday Lingala , "James E.J. Bottomley" , megaraidlinux.pdl@avagotech.com, linux-scsi@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] megaraid_sas: fix missing { } braces Date: Mon, 3 Aug 2015 16:00:29 +0100 Message-Id: <1438614029-4257-1-git-send-email-colin.king@canonical.com> X-Mailer: git-send-email 2.5.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Colin Ian King Static analysis by smatch indicated that there was a curly braces issue: drivers/scsi/megaraid/megaraid_sas_base.c:6139 megasas_mgmt_fw_ioctl() warn: curly braces intended? Add braces in the appropriate place so that kbuf_arr[i] gets set to NULL only when we need to. Also, remove whitespace between kbuff_arr and []. Signed-off-by: Colin Ian King Reviewed-by: Johannes Thumshirn --- 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 71b884d..8face78 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -6131,12 +6131,13 @@ megasas_mgmt_fw_ioctl(struct megasas_instance *instance, } 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);