mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
scst_sysfs: Avoid NULL ptr deref. Fix online documentation
Avoid that the PRINT_ERROR() statement that complains about too many parameters triggers a NULL pointer dereference. Also, fix the online documentation for the LUN deletion command. Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4483 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1270,8 +1270,8 @@ static int __scst_process_luns_mgmt_store(char *buffer,
|
||||
goto out_unlock;
|
||||
|
||||
if (scst_get_next_lexem(&pp)[0] != '\0') {
|
||||
PRINT_ERROR("Too many parameters for device %s: %s",
|
||||
p, dev->virt_name);
|
||||
PRINT_ERROR("Too many parameters for del LUN %ld: %s",
|
||||
virt_lun, p);
|
||||
res = -EINVAL;
|
||||
goto out_unlock;
|
||||
}
|
||||
@@ -1282,8 +1282,7 @@ static int __scst_process_luns_mgmt_store(char *buffer,
|
||||
break;
|
||||
case SCST_LUN_ACTION_CLEAR:
|
||||
if (scst_get_next_lexem(&pp)[0] != '\0') {
|
||||
PRINT_ERROR("Too many parameters for device %s: %s",
|
||||
p, dev->virt_name);
|
||||
PRINT_ERROR("Too many parameters for clear: %s", p);
|
||||
res = -EINVAL;
|
||||
goto out_unlock;
|
||||
}
|
||||
@@ -1370,7 +1369,7 @@ static ssize_t scst_luns_mgmt_show(struct kobject *kobj,
|
||||
char *buf)
|
||||
{
|
||||
static const char help[] =
|
||||
"Usage: echo \"add|del H:C:I:L lun [parameters]\" >mgmt\n"
|
||||
"Usage: echo \"add H:C:I:L lun [parameters]\" >mgmt\n"
|
||||
" echo \"add VNAME lun [parameters]\" >mgmt\n"
|
||||
" echo \"del lun\" >mgmt\n"
|
||||
" echo \"replace H:C:I:L lun [parameters]\" >mgmt\n"
|
||||
|
||||
Reference in New Issue
Block a user