linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] input: keypad: tc3589x: localize platform data
Date: Tue, 7 Apr 2015 15:07:32 +0200	[thread overview]
Message-ID: <CACRpkdY+o+uddX-r_oZsmeH6PyjhgUveaUHAV+Wg5tDPHEcxkw@mail.gmail.com> (raw)
In-Reply-To: <20150327164744.GA17364@dtor-ws>

On Fri, Mar 27, 2015 at 5:47 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:

> Hmm, just noticed an issue:
>
>> >
>> >     keypad = kzalloc(sizeof(struct tc_keypad), GFP_KERNEL);
>> > +   keypad->board = tc3589x_keypad_of_probe(&pdev->dev);
>> > +   if (IS_ERR(keypad->board)) {
>> > +           dev_err(&pdev->dev, "invalid keypad platform data\n");
>> > +           return PTR_ERR(keypad->board);
>> > +   }
>> > +
>> >     input = input_allocate_device();
>> >     if (!keypad || !input) {
>> >             dev_err(&pdev->dev, "failed to allocate keypad memory\n");
>
> You slid of prasing right in between memory allocation and checking if
> it succeeded, so there is a potential oops and memory leak now.
>
> I want to commit the version of the patch below, holler if you disagree.
> Note that I reverted much of plat -> board renames to keep the patch
> small.

Sorry. The new version looks fine. Reviewed-by.

Yours,
Linus Walleij

  parent reply	other threads:[~2015-04-07 13:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19 14:52 [PATCH 0/2] tc3589x OF only enforcement Linus Walleij
2015-03-19 14:52 ` [PATCH 1/2] input: keypad: tc3589x: localize platform data Linus Walleij
2015-03-19 16:38   ` Dmitry Torokhov
2015-03-27 16:47     ` Dmitry Torokhov
2015-03-30  7:08       ` Lee Jones
2015-04-07 13:07       ` Linus Walleij [this message]
2015-03-27 11:52   ` Lee Jones
2015-03-19 14:52 ` [PATCH 2/2] mfd: tc3589x: enforce device-tree only mode Linus Walleij
2015-03-19 17:00   ` Dmitry Torokhov
2015-03-20  8:21   ` Lee Jones
2015-03-27 11:53   ` Lee Jones
2015-03-27  9:04 ` [PATCH 0/2] tc3589x OF only enforcement Linus Walleij
2015-03-27 12:00   ` Lee Jones
2015-03-27 16:48     ` Dmitry Torokhov

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=CACRpkdY+o+uddX-r_oZsmeH6PyjhgUveaUHAV+Wg5tDPHEcxkw@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).