bus/vmbus: close directory in error path
authorStephen Hemminger <sthemmin@microsoft.com>
Mon, 6 Aug 2018 18:11:06 +0000 (11:11 -0700)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 7 Aug 2018 12:41:40 +0000 (14:41 +0200)
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 <sthemmin@microsoft.com>
drivers/bus/vmbus/linux/vmbus_uio.c

index b0f8eba..0b1b153 100644 (file)
@@ -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;
                }