Fix potential NULL pointer dereference in zfsdle_vdev_online()

Coverity complained about this.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Chunwei Chen <david.chen@nutanix.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #13903
This commit is contained in:
Richard Yao 2022-09-20 18:20:04 -04:00 committed by Tony Hutter
parent c6d93d0a80
commit 1ff8f41851
1 changed files with 1 additions and 1 deletions

View File

@ -964,7 +964,7 @@ zfsdle_vdev_online(zpool_handle_t *zhp, void *data)
nvlist_t *tgt; nvlist_t *tgt;
int error; int error;
char *tmp_devname, devname[MAXPATHLEN]; char *tmp_devname, devname[MAXPATHLEN] = "";
uint64_t guid; uint64_t guid;
if (nvlist_lookup_uint64(udev_nvl, ZFS_EV_VDEV_GUID, &guid) == 0) { if (nvlist_lookup_uint64(udev_nvl, ZFS_EV_VDEV_GUID, &guid) == 0) {