From bca88be88a6fbfe5bc108693444d2ede5b23bf2b Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 6 Aug 2018 11:11:06 -0700 Subject: [PATCH] bus/vmbus: close directory in error path Fix bug reported by Coverity where directory being scanned was not closed in error path (leaking file descriptor). Coverity issue: 302848 Fixes: 831dba47bd36 ("bus/vmbus: add Hyper-V virtual bus support") Signed-off-by: Stephen Hemminger --- drivers/bus/vmbus/linux/vmbus_uio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c index b0f8ebaea6..0b1b153cc0 100644 --- a/drivers/bus/vmbus/linux/vmbus_uio.c +++ b/drivers/bus/vmbus/linux/vmbus_uio.c @@ -357,6 +357,7 @@ int vmbus_uio_get_subchan(struct vmbus_channel *primary, if (err) { VMBUS_LOG(NOTICE, "invalid subchannel id %lu", subid); + closedir(chan_dir); return err; } -- 2.20.1