From: Artem Bityutskiy Date: Sun, 16 Dec 2007 14:46:57 +0000 (+0200) Subject: UBI: bugfix: dont oops with NULL module parameter X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=77c722dde9975361051c5530475f8f92ed67a506;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git UBI: bugfix: dont oops with NULL module parameter E.g., it oopsed in case of: modprobe ubi mtd = 0 Signed-off-by: Artem Bityutskiy --- diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 9b94427be14..b85ca186afc 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);