mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 21:56:31 +00:00
Fix handling of host templates with NULL names
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1822 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1926,7 +1926,8 @@ static int scst_add(struct device *cdev, struct class_interface *intf)
|
||||
scsidp = to_scsi_device(cdev->parent);
|
||||
#endif
|
||||
|
||||
if (strcmp(scsidp->host->hostt->name, SCST_LOCAL_NAME) != 0)
|
||||
if ((scsidp->host->hostt->name == NULL) ||
|
||||
(strcmp(scsidp->host->hostt->name, SCST_LOCAL_NAME) != 0))
|
||||
res = scst_register_device(scsidp);
|
||||
|
||||
TRACE_EXIT();
|
||||
@@ -1949,7 +1950,8 @@ static void scst_remove(struct device *cdev, struct class_interface *intf)
|
||||
scsidp = to_scsi_device(cdev->parent);
|
||||
#endif
|
||||
|
||||
if (strcmp(scsidp->host->hostt->name, SCST_LOCAL_NAME) != 0)
|
||||
if ((scsidp->host->hostt->name == NULL) ||
|
||||
(strcmp(scsidp->host->hostt->name, SCST_LOCAL_NAME) != 0))
|
||||
scst_unregister_device(scsidp);
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
Reference in New Issue
Block a user