Skip to content

Commit

Permalink
Remove incorrect free() in zfs_get_pci_slots_sys_path()
Browse files Browse the repository at this point in the history
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 <ngompa@datto.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes openzfs#13864
  • Loading branch information
ryao authored and andrewc12 committed Sep 27, 2022
1 parent 28ad65e commit 84734d5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/libzutil/os/linux/zutil_device_path_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 84734d5

Please sign in to comment.