]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
plugins/wdc: prevent duplicate close on NVMe device
authorJeremy Kerr <jk@codeconstruct.com.au>
Tue, 12 Jul 2022 05:28:17 +0000 (13:28 +0800)
committerJeremy Kerr <jk@codeconstruct.com.au>
Wed, 3 Aug 2022 07:30:19 +0000 (15:30 +0800)
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 <jk@codeconstruct.com.au>
plugins/wdc/wdc-nvme.c

index d506fec34f24e3467f239b5d435354c2796ec7d2..2ace00a87dc42d3b7ca5ef548b365be6e80742cb 100644 (file)
@@ -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;
 }