[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20101120213730.GA16712@core.coreip.homeip.net>
Date: Sat, 20 Nov 2010 13:37:30 -0800
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Helge Deller <deller@....de>
Cc: Jesper Juhl <jj@...osbits.net>, linux-input@...r.kernel.org,
linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
André Goddard Rosa <andre.goddard@...il.com>,
Jiri Kosina <jkosina@...e.cz>
Subject: Re: [PATCH RFC] serio HIL MLC: don't deref null, don't leak and
return proper error
On Sat, Nov 20, 2010 at 10:13:45PM +0100, Helge Deller wrote:
> On 11/09/2010 07:35 AM, Dmitry Torokhov wrote:
> >On Sun, Nov 07, 2010 at 08:36:33PM +0100, Jesper Juhl wrote:
> >>Hi,
> >>
> >>While reviewing various users of kernel memory allocation functions I came
> >>across drivers/input/serio/hil_mlc.c::hil_mlc_register() and noticed that
> >> - it calls kzalloc() buf fails to check for a NULL return before use.
> >> - it makes several allocations and if one fails it doesn't free the
> >> previous ones.
> >> - It doesn't return -ENOMEM in the failed memory allocation case (it just
> >> crashes).
> >>This patch corrects all of the above and also reworks the only caller of
> >>this function that I could find
> >>(drivers/input/serio/hp_sdc_mlc.c::hp_sdc_mlc_out()) so that it now checks
> >>the return value of hil_mlc_register() and properly propagate it on
> >>failure and I also restructured the code to remove some labels and goto's
> >>to make it, IMHO nicer to read.
> >>
> >>I have no hardware to test, so please review carefully and let me know if
> >>I've done something completely stupid. Please don't merge this RFC patch
> >>unless at least one or more people who know this code and can actually
> >>test it have ACK'ed it.
> >I think Helge Deller (CCed) used to have access to such hardware...
>
> Yes, and I tested the patch successfully.
>
> Tested-by: Helge Deller <deller@....de>
> Acked-by: Helge Deller <deller@....de>
>
Applied, thank you guys.
--
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists