[PATCH] scsi/aic7xxx/aicasm: Add missing fclose() call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add missing fclose() call to close "regdiagfile" in the function stop().

Signed-off-by: Youling Tang <tangyouling@xxxxxxxxxxx>
---
 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();
 
-- 
2.1.0




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux