From 408b67c80ffc65ee08d1aefb508bdf012d439896 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 17 Jul 2012 20:09:37 +0000 Subject: [PATCH] Make invalid LUN message more comprehensive git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4407 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_sysfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index 0509703d9..29d38d37f 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -1149,9 +1149,11 @@ static int __scst_process_luns_mgmt_store(char *buffer, #else res = strict_strtoul(e, 0, &virt_lun); #endif - if (res != 0 || virt_lun > SCST_MAX_LUN) { - PRINT_ERROR("Invalid value or too big LUN %s " - "(max %d, res %d)", p, SCST_MAX_LUN, res); + if (res != 0) { + PRINT_ERROR("Valid LUN required for dev %s (res %d)", p, res); + goto out_unlock; + } else if (virt_lun > SCST_MAX_LUN) { + PRINT_ERROR("Too big LUN %ld (max %d)", virt_lun, SCST_MAX_LUN); goto out_unlock; }