From: Jim Meyering Date: Tue, 29 Apr 2008 07:59:07 +0000 (-0700) Subject: hfs: handle match_strdup failure X-Git-Tag: v2.6.26-rc1~648 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fbe5c31009d26c7b6b73d5c69fe930a5e9d2e26;p=linux-2.6 hfs: handle match_strdup failure fs/hfs/super.c (parse_options): Handle match_strdup failure, twice. Signed-off-by: Jim Meyering Cc: Roman Zippel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/hfs/super.c b/fs/hfs/super.c index 32de44ed00..8cf67974ad 100644 --- a/fs/hfs/super.c +++ b/fs/hfs/super.c @@ -297,7 +297,8 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) return 0; } p = match_strdup(&args[0]); - hsb->nls_disk = load_nls(p); + if (p) + hsb->nls_disk = load_nls(p); if (!hsb->nls_disk) { printk(KERN_ERR "hfs: unable to load codepage \"%s\"\n", p); kfree(p); @@ -311,7 +312,8 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) return 0; } p = match_strdup(&args[0]); - hsb->nls_io = load_nls(p); + if (p) + hsb->nls_io = load_nls(p); if (!hsb->nls_io) { printk(KERN_ERR "hfs: unable to load iocharset \"%s\"\n", p); kfree(p);