summaryrefslogtreecommitdiffstats
path: root/module/zfs
diff options
context:
space:
mode:
authorcao <[email protected]>2016-10-15 02:00:47 +0800
committerBrian Behlendorf <[email protected]>2016-10-14 11:00:47 -0700
commitb6ca6193f7678a9d8790f4319c982cc34b59f150 (patch)
tree723fea856a781f217ecc5e4389b9bcedd1c34856 /module/zfs
parent3691598e26a878df792480e0a97ea5c2bf012e49 (diff)
Fix coverity defects: CID 147488, 147490
CID 147488, Type:explicit null dereferenced CID 147490, Type:dereference null return value Reviewed-by: Giuseppe Di Natale <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5237
Diffstat (limited to 'module/zfs')
-rw-r--r--module/zfs/spa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 0cf07be9b..ec6924a02 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -4947,7 +4947,7 @@ spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
* But first make sure we're not on any *other* txg's DTL list, to
* prevent vd from being accessed after it's freed.
*/
- vdpath = spa_strdup(vd->vdev_path);
+ vdpath = spa_strdup(vd->vdev_path ? vd->vdev_path : "none");
for (t = 0; t < TXG_SIZE; t++)
(void) txg_list_remove_this(&tvd->vdev_dtl_list, vd, t);
vd->vdev_detached = B_TRUE;