From fcd7293d4e7852a99c5c57443d6799895e10bc9f Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Tue, 13 Sep 2022 20:00:53 -0400 Subject: [PATCH] Remove incorrect free() in zfs_get_pci_slots_sys_path() Coverity found this. We attempted to free tmp, which is a pointer to a string that should be freed by the caller. Reviewed-by: Neal Gompa Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf Signed-off-by: Richard Yao Closes #13864 --- lib/libzutil/os/linux/zutil_device_path_os.c | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/libzutil/os/linux/zutil_device_path_os.c b/lib/libzutil/os/linux/zutil_device_path_os.c index f081ef53d..9f4c74f50 100644 --- a/lib/libzutil/os/linux/zutil_device_path_os.c +++ b/lib/libzutil/os/linux/zutil_device_path_os.c @@ -273,7 +273,6 @@ zfs_get_pci_slots_sys_path(const char *dev_name) free(address2); if (asprintf(&path, "/sys/bus/pci/slots/%s", ep->d_name) == -1) { - free(tmp); continue; } break;