Fix coverity defects: CID 161288

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
This commit is contained in:
Giuseppe Di Natale 2017-04-06 13:18:22 -07:00 committed by Brian Behlendorf
parent c1d9abf905
commit f02ad0dc75

View 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;
/*