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:
Vladislav Bolkhovitin
2010-07-14 13:31:39 +00:00
parent 571df65257
commit 48d762e5cb
+4 -2
View File
@@ -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();