]> granicus.if.org Git - zfs/commitdiff
Fix coverity defects: CID 161288
authorGiuseppe Di Natale <dinatale2@users.noreply.github.com>
Thu, 6 Apr 2017 20:18:22 +0000 (13:18 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 6 Apr 2017 20:18:22 +0000 (13:18 -0700)
CID 161288:  Null pointer dereferences  (REVERSE_INULL)

Ensure physpath != NULL before the strcmp.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5974

cmd/zed/agents/zfs_mod.c

index 7ebf708aeac6f6d6e59da08caf7e814bb9139ba6..8f2f60bbfb94bab747c707e71102d522c4ee937c 100644 (file)
@@ -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;
 
        /*