mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 04:01:26 +00:00
isert: Do not crash kernel if userspace has a bug
Signed-off-by: Yan Burman <yanb@mellanox.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5901 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -573,7 +573,9 @@ static ssize_t isert_read(struct file *filp, char __user *buf, size_t count,
|
||||
break;
|
||||
|
||||
default:
|
||||
sBUG();
|
||||
PRINT_ERROR("Invalid state in %s (%d)\n", __func__,
|
||||
dev->state);
|
||||
to_read = 0;
|
||||
}
|
||||
|
||||
return to_read;
|
||||
@@ -615,7 +617,9 @@ static ssize_t isert_write(struct file *filp, const char __user *buf,
|
||||
break;
|
||||
|
||||
default:
|
||||
sBUG();
|
||||
PRINT_ERROR("Invalid state in %s (%d)\n", __func__,
|
||||
dev->state);
|
||||
to_write = 0;
|
||||
}
|
||||
|
||||
return to_write;
|
||||
|
||||
Reference in New Issue
Block a user