From 48d762e5cb79a61123bd131945abb8c6321f5a8e Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 14 Jul 2010 13:31:39 +0000 Subject: [PATCH] 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 --- scst/src/scst_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 487582c2e..7aded3faa 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -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();