From 3f380df778c67bf6919df088ed9635323a6b6ffb 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 45a6f6f593..e443899bf1 100644 --- a/lib/libzutil/os/linux/zutil_device_path_os.c +++ b/lib/libzutil/os/linux/zutil_device_path_os.c @@ -265,7 +265,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;