login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
April
»
22
Re: [PATCH] hfs: if match_strdup() fails to allocate memory in parse_options(), don't blow up the kernel.
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Joe Perches
Subject:
Re: [PATCH] hfs: if match_strdup() fails to allocate memory in parse_options(), don't blow up the kernel.
Date: Tuesday, April 22, 2008 - 2:17 pm
On Tue, 2008-04-22 at 23:12 +0200, Jesper Juhl wrote:
quoted text
> From: Jesper Juhl <jesper.juhl@gmail.com> > diff --git a/fs/hfs/super.c b/fs/hfs/super.c > index 32de44e..221e314 100644 > --- a/fs/hfs/super.c > +++ b/fs/hfs/super.c > @@ -297,6 +297,10 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) > return 0; > } > p = match_strdup(&args[0]); > + if (!p) { > + printk(KERN_ERR "hfs: mem alloc failed in match_strdup()\n"); > + return 0; > + } > hsb->nls_disk = load_nls(p); > if (!hsb->nls_disk) { > printk(KERN_ERR "hfs: unable to load codepage \"%s\"\n", p); > @@ -311,6 +315,10 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) > return 0; > } > p = match_strdup(&args[0]); > + if (!p) { > + printk(KERN_ERR "hfs: memory allocation failed in match_strdup()\n"); > + return 0; > + } > hsb->nls_io = load_nls(p); > if (!hsb->nls_io) { > printk(KERN_ERR "hfs: unable to load iocharset \"%s\"\n", p); >
Using different strings in the printk wastes memory. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] hfs: if match_strdup() fails to allocate memory in ...
, Jesper Juhl
, (Tue Apr 22, 2:12 pm)
Re: [PATCH] hfs: if match_strdup() fails to allocate memor ...
, Joe Perches
, (Tue Apr 22, 2:17 pm)
Re: [PATCH] hfs: if match_strdup() fails to allocate memor ...
, Jesper Juhl
, (Tue Apr 22, 2:21 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Alexey Dobriyan
Re: [2.6.22.2 review 09/84] Fix rfkill IRQ flags.
Michael Moore
Re: underage models, pre teen models, lolita porn, young preteens, little lolitas
Alex Riesen
Re: [PATCH 4/7] lib: Introduce strnstr()
Thomas Gleixner
[ANNOUNCE] 2.6.31-rc6-rt2
Mathieu Desnoyers
Re: Linux 2.6.25-rc2
git
:
Blaisorblade
git-unpack-objects < pack file in repository doesn't work!
Matthieu Moy
Re: Cloning empty repositories, was Re: What is the idea for bare repositories?
Linus Torvalds
Re: Untracked working tree files
Peter Karlsson
Re: CRLF problems with Git on Win32
Johannes Schindelin
Re: [PATCH 4/4] git-rebase -i: New option to support rebase with merges
linux-netdev
:
Alan Menegotto
Re: Linux networking implementation and packet capture
Andrew Morton
Re: [PATCH] PHYLIB: IRQ event workqueue handling fixes
Timo Teräs
ip xfrm policy semantics
Jarek Poplawski
Re: [PATCH]: Fix queueing return values...
David Miller
Re: [PATCH 1/2] netdev: bfin_mac: enable bfin_mac net dev driver for BF51x
git-commits-head
:
Linux Kernel Mailing List
Blackfin: don't give CPU its own line in traps output
Linux Kernel Mailing List
No need to do lock_super() for exclusion in generic_shutdown_super()
Linux Kernel Mailing List
x86, msr: Export the register-setting MSR functions via /dev/*/msr
Linux Kernel Mailing List
MIPS: SMTC: Fix lockup in smtc_distribute_timer
Linux Kernel Mailing List
powerpc: gamecube/wii: usbgecko bootwrapper console support
openbsd-misc
:
Aaron Mason
Re: Defending OpenBSD Performance
Henning Brauer
Re: Defending OpenBSD Performance
Henning Brauer
Re: Defending OpenBSD Performance
Christiano Farina Haesbaert
Re: Defending OpenBSD Performance
Nick Holland
Re: 1 out of 3 hunks failed--saving rejects to kerberosV/src/lib/krb5/crypto.c.rej
Colocation donated by:
Syndicate