From: Jeremy Kerr Date: Tue, 12 Jul 2022 05:28:17 +0000 (+0800) Subject: plugins/wdc: prevent duplicate close on NVMe device X-Git-Tag: v2.1.2~3^2~6 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9fbef859c28b4bd98a1b6bcb57fe3250d2634803;p=users%2Fsagi%2Fnvme-cli.git 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 --- 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; }