From patchwork Mon Aug 3 05:17:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Youling Tang X-Patchwork-Id: 11697139 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 082F2138C for ; Mon, 3 Aug 2020 05:17:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EDFC82065C for ; Mon, 3 Aug 2020 05:17:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbgHCFRl (ORCPT ); Mon, 3 Aug 2020 01:17:41 -0400 Received: from mail.loongson.cn ([114.242.206.163]:38314 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725976AbgHCFRl (ORCPT ); Mon, 3 Aug 2020 01:17:41 -0400 Received: from bogon.localdomain (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxn9znnSdfW+wDAA--.1065S2; Mon, 03 Aug 2020 13:17:27 +0800 (CST) From: Youling Tang To: Hannes Reinecke , "James E.J. Bottomley" , "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] scsi/aic7xxx/aicasm: Add missing fclose() call Date: Mon, 3 Aug 2020 13:17:27 +0800 Message-Id: <1596431847-1402-1-git-send-email-tangyouling@loongson.cn> X-Mailer: git-send-email 2.1.0 X-CM-TRANSID: AQAAf9Dxn9znnSdfW+wDAA--.1065S2 X-Coremail-Antispam: 1UD129KBjvdXoWrKr4kJF1DZF1rXr4DtrW3Awb_yoW3Crg_Cr W0qwsaqa4UWr4fKayjqanFvr9Y9w4kZw17uw1SqwnxAa4rXryUGrykCFW8JF1UAws8AF1U t343Xr4rCF12gjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb2AYjsxI4VWxJwAYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I 6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM2 8CjxkF64kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0 cI8IcVCY1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I 8E87Iv6xkF7I0E14v26F4UJVW0owAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUXVWUAwAv7VC2z280aVAFwI0_Gr0_Cr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxkIecxEwVAFwVW8WwCF04k2 0xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI 8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_JF0_Jw1lIxkGc2Ij64vIr41l IxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIx AIcVCF04k26cxKx2IYs7xG6rWUJVWrZr1UMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvE x4A2jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x07jw4SrUUUUU= X-CM-SenderInfo: 5wdqw5prxox03j6o00pqjv00gofq/ Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Add missing fclose() call to close "regdiagfile" in the function stop(). Signed-off-by: Youling Tang --- drivers/scsi/aic7xxx/aicasm/aicasm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/scsi/aic7xxx/aicasm/aicasm.c b/drivers/scsi/aic7xxx/aicasm/aicasm.c index 5f474e4..a504058 100644 --- a/drivers/scsi/aic7xxx/aicasm/aicasm.c +++ b/drivers/scsi/aic7xxx/aicasm/aicasm.c @@ -722,6 +722,15 @@ stop(const char *string, int err_code) } } + if (regdiagfile != NULL) { + fclose(regdiagfile); + if (err_code != 0) { + fprintf(stderr, "%s: Removing %s due to error\n", + appname, regdiagfilename); + unlink(regdiagfilename); + } + } + symlist_free(&patch_functions); symtable_close();