Skip to content

Commit

Permalink
UBI: bugfix: dont oops with NULL module parameter
Browse files Browse the repository at this point in the history
E.g., it oopsed in case of: modprobe ubi mtd = 0

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Dec 26, 2007
1 parent b96bf4c commit 77c722d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mtd/ubi/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,9 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
char *pbuf = &buf[0];
char *tokens[3] = {NULL, NULL, NULL};

if (!val)
return -EINVAL;

if (mtd_devs == UBI_MAX_DEVICES) {
printk("UBI error: too many parameters, max. is %d\n",
UBI_MAX_DEVICES);
Expand Down

0 comments on commit 77c722d

Please sign in to comment.