UBI: bugfix: dont oops with NULL module parameter

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 8 02:59:02 EST 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=77c722dde9975361051c5530475f8f92ed67a506
Commit:     77c722dde9975361051c5530475f8f92ed67a506
Parent:     b96bf4c33d4860bf1584ad2f9ed3b783d79aada8
Author:     Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
AuthorDate: Sun Dec 16 16:46:57 2007 +0200
Committer:  Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
CommitDate: Wed Dec 26 19:15:15 2007 +0200

    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 at nokia.com>
---
 drivers/mtd/ubi/build.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 9b94427..b85ca18 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);



More information about the linux-mtd-cvs mailing list