Messages in this thread | | | Date | Tue, 7 Apr 2015 15:07:32 +0200 | Subject | Re: [PATCH 1/2] input: keypad: tc3589x: localize platform data | From | Linus Walleij <> |
| |
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
| |