lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 30 Mar 2015 08:08:29 +0100
From:	Lee Jones <lee.jones@...aro.org>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
	linux-input@...r.kernel.org
Subject: Re: [PATCH 1/2] input: keypad: tc3589x: localize platform data

On Fri, 27 Mar 2015, Dmitry Torokhov wrote:

> On Thu, Mar 19, 2015 at 09:38:56AM -0700, Dmitry Torokhov wrote:
> > Hi Linus,
> > 
> > On Thu, Mar 19, 2015 at 03:52:44PM +0100, Linus Walleij wrote:
> > > This driver can only get its platform data from the device tree,
> > > and all platforms using it does that. Localize the platform data
> > > for the keypad. A later patch will enforce the device tree / OF
> > > dependence.
> > > 
> > > Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>
> > > Cc: Lee Jones <lee.jones@...aro.org>
> > > Signed-off-by: Linus Walleij <linus.walleij@...aro.org>
> > > ---
> > > Dmitry it would be great if you could ACK this patch so Lee can
> > > take it with the other patch through MFD.
> > 
> > It looks like if you are making this OF-only you can get rid of pdata
> > altogether and parse the OF data directly into the keypad. But that can
> > be done later.
> > 
> > Acked-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> 
> 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.

Acked-by: Lee Jones <lee.jones@...aro.org>

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ