From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Helge Deller <deller@gmx.de>
Cc: "Jesper Juhl" <jj@chaosbits.net>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
"Tejun Heo" <tj@kernel.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"André Goddard Rosa" <andre.goddard@gmail.com>,
"Jiri Kosina" <jkosina@suse.cz>
Subject: Re: [PATCH RFC] serio HIL MLC: don't deref null, don't leak and return proper error
Date: Sat, 20 Nov 2010 13:37:30 -0800 [thread overview]
Message-ID: <20101120213730.GA16712@core.coreip.homeip.net> (raw)
In-Reply-To: <4CE83A09.5020000@gmx.de>
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@gmx.de>
> Acked-by: Helge Deller <deller@gmx.de>
>
Applied, thank you guys.
--
Dmitry
prev parent reply other threads:[~2010-11-20 21:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-07 19:36 Jesper Juhl
2010-11-09 6:35 ` Dmitry Torokhov
2010-11-20 21:13 ` Helge Deller
2010-11-20 21:37 ` Dmitry Torokhov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101120213730.GA16712@core.coreip.homeip.net \
--to=dmitry.torokhov@gmail.com \
--cc=andre.goddard@gmail.com \
--cc=deller@gmx.de \
--cc=jj@chaosbits.net \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®