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 GitHub
parent c50b3f14d3
commit de6c0d3d8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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