Env: close the FD in failed case

Change-Id: I290571bf11ff7365fb7b56282b0e60c20871d9ff
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7428
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Xiaodong Liu <xiaodong.liu@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
GangCao 2021-04-16 14:09:08 -04:00 committed by Jim Harris
parent 391d89b873
commit 303d670f8e

View File

@ -66,6 +66,7 @@ spdk_pci_event_listen(void)
if (setsockopt(netlink_fd, SOL_SOCKET, SO_RCVBUFFORCE, &size, sizeof(size)) < 0) {
rc = errno;
SPDK_ERRLOG("Failed to set socket option\n");
close(netlink_fd);
return -rc;
}