diff options
author | cao <[email protected]> | 2016-11-09 06:28:17 +0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-11-08 14:28:17 -0800 |
commit | a36cc8d2428259f5cfefb653bff39ca7afc66518 (patch) | |
tree | c76a5c3dda816ad8e2194bfbb72cdda69bc5e1b9 /module/zfs/zfs_fm.c | |
parent | ffb78320c8040e10e754f1358476beb04c943510 (diff) |
Fix coverity defects: CID 147626, 147628
CID 147626: Type:Dereference before null check
CID 147628: Type:Dereference before null check
Reviewed-by: Brian Behlendorf <[email protected]
Reviewed-by: Chunwei Chen <[email protected]>
Signed-off-by: cao.xuewen <[email protected]>
Closes #5304
Diffstat (limited to 'module/zfs/zfs_fm.c')
-rw-r--r-- | module/zfs/zfs_fm.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/module/zfs/zfs_fm.c b/module/zfs/zfs_fm.c index df37fed2b..d2f456d17 100644 --- a/module/zfs/zfs_fm.c +++ b/module/zfs/zfs_fm.c @@ -272,15 +272,13 @@ zfs_ereport_start(nvlist_t **ereport_out, nvlist_t **detector_out, FM_EREPORT_PAYLOAD_ZFS_POOL_CONTEXT, DATA_TYPE_INT32, spa_load_state(spa), NULL); - if (spa != NULL) { - fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE, - DATA_TYPE_STRING, - spa_get_failmode(spa) == ZIO_FAILURE_MODE_WAIT ? - FM_EREPORT_FAILMODE_WAIT : - spa_get_failmode(spa) == ZIO_FAILURE_MODE_CONTINUE ? - FM_EREPORT_FAILMODE_CONTINUE : FM_EREPORT_FAILMODE_PANIC, - NULL); - } + fm_payload_set(ereport, FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE, + DATA_TYPE_STRING, + spa_get_failmode(spa) == ZIO_FAILURE_MODE_WAIT ? + FM_EREPORT_FAILMODE_WAIT : + spa_get_failmode(spa) == ZIO_FAILURE_MODE_CONTINUE ? + FM_EREPORT_FAILMODE_CONTINUE : FM_EREPORT_FAILMODE_PANIC, + NULL); if (vd != NULL) { vdev_t *pvd = vd->vdev_parent; |