From 9fbef859c28b4bd98a1b6bcb57fe3250d2634803 Mon Sep 17 00:00:00 2001 From: Jeremy Kerr Date: Tue, 12 Jul 2022 13:28:17 +0800 Subject: [PATCH] plugins/wdc: prevent duplicate close on NVMe device wdc_crash_dump() will close the NVMe device file descriptor, but so do all of its callers. This change removes the unnecessary close(), as well as a stray backslash on the previous line (which may cause unexpected indentation warnings). Signed-off-by: Jeremy Kerr --- plugins/wdc/wdc-nvme.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/wdc/wdc-nvme.c b/plugins/wdc/wdc-nvme.c index d506fec3..2ace00a8 100644 --- a/plugins/wdc/wdc-nvme.c +++ b/plugins/wdc/wdc-nvme.c @@ -3498,8 +3498,7 @@ static int wdc_crash_dump(int fd, char *file, int type) if (ret) fprintf(stderr, "ERROR : WDC : failed to generate file name\n"); else - ret = wdc_do_crash_dump(fd, f, type); \ - close(fd); + ret = wdc_do_crash_dump(fd, f, type); return ret; } -- 2.50.1