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:
Yan Burman
2014-11-30 08:17:29 +00:00
parent 5c1d9a4501
commit e6e1752b8f

View File

@@ -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;