This was an easy-to-fix false positive. Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> --- kpartx/dasd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kpartx/dasd.c b/kpartx/dasd.c index 94ae81b..fb358ad 100644 --- a/kpartx/dasd.c +++ b/kpartx/dasd.c @@ -137,7 +137,7 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns) /* Not a DASD */ return -1; } else { - fd_dasd = fd; + fd_dasd = dup(fd); } if (ioctl(fd_dasd, BIODASDINFO, (unsigned long)&info) != 0) { @@ -288,7 +288,6 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns) out: if (data != NULL) free(data); - if (fd_dasd != -1 && fd_dasd != fd) - close(fd_dasd); + close(fd_dasd); return retval; } -- 2.19.2 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel