summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-16 15:46:57 +0100
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2007-12-26 18:15:15 +0100
commit77c722dde9975361051c5530475f8f92ed67a506 (patch)
treea2d4acd9f868a5d9fb5fcf96d7a7af488246e98c /drivers/mtd
parentUBI: remove ubi_devices_cnt (diff)
downloadlinux-77c722dde9975361051c5530475f8f92ed67a506.tar.xz
linux-77c722dde9975361051c5530475f8f92ed67a506.zip
UBI: bugfix: dont oops with NULL module parameter
E.g., it oopsed in case of: modprobe ubi mtd = 0 Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/ubi/build.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 9b94427be145..b85ca186afc6 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -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);