From f02ad0dc751662dd15537c54c3e25bca9ccefa6c Mon Sep 17 00:00:00 2001 From: Giuseppe Di Natale Date: Thu, 6 Apr 2017 13:18:22 -0700 Subject: [PATCH] Fix coverity defects: CID 161288 CID 161288: Null pointer dereferences (REVERSE_INULL) Ensure physpath != NULL before the strcmp. Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: Giuseppe Di Natale Closes #5974 --- cmd/zed/agents/zfs_mod.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c index 7ebf708ae..8f2f60bbf 100644 --- a/cmd/zed/agents/zfs_mod.c +++ b/cmd/zed/agents/zfs_mod.c @@ -264,7 +264,7 @@ zfs_process_add(zpool_handle_t *zhp, nvlist_t *vdev, boolean_t labeled) * vdev_id alias rule for using scsi_debug devices (FMA automated * testing) */ - if (strcmp("scsidebug", physpath) == 0) + if (physpath != NULL && strcmp("scsidebug", physpath) == 0) is_sd = 1; /* -- 2.40.0