Skip to content

Commit

Permalink
Cleanup: Delete unnecessary pointer check from vdev_to_nvlist_iter()
Browse files Browse the repository at this point in the history
This confused Clang's static analyzer, making it think there was a
possible NULL pointer dereference. There is no NULL pointer dereference.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Richard Yao <[email protected]>
Closes #14042
  • Loading branch information
ryao authored and behlendorf committed Oct 18, 2022
1 parent 9a80394 commit d953bcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/libzfs/libzfs_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -2678,7 +2678,7 @@ vdev_to_nvlist_iter(nvlist_t *nv, nvlist_t *search, boolean_t *avail_spare,
if (zfs_strcmp_pathname(srchval, val, wholedisk) == 0)
return (nv);

} else if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0 && val) {
} else if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0) {
char *type, *idx, *end, *p;
uint64_t id, vdev_id;

Expand Down

0 comments on commit d953bcb

Please sign in to comment.