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:	Wed, 08 Aug 2012 12:46:40 -0700
From:	Dmitry Torokhov <dmitry.torokhov@...il.com>
To:	Jesper Juhl <jj@...osbits.net>
Cc:	Sachin Kamat <sachin.kamat@...aro.org>,
	Sourav Poddar <sourav.poddar@...com>,
	Felipe Balbi <balbi@...com>, JJ Ding <dgdunix@...il.com>,
	linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
	Abraham Arce <x0066660@...com>,
	Syed Rafiuddin <rafiuddin.syed@...com>
Subject: Re: [PATCH] Input: omap4-keypad - don't leak in omap4_keypad_probe()

On Wednesday, August 08, 2012 09:36:51 PM Jesper Juhl wrote:
> On Wed, 8 Aug 2012, Sachin Kamat wrote:
> > On 7 August 2012 23:46, Jesper Juhl <jj@...osbits.net> wrote:
> > > If omap4_keypad_parse_dt() does not return 0 (zero) in
> > > omap4_keypad_probe() we will leak the memory we allocated for
> > > 'keypad_data' with kzalloc() when we return and the variable goes out
> > > of scope.
> > 
> > How about using devm_kzalloc() instead which will take care of freeing
> > the memory on detach?
> 
> Perhaps. I'm not (yet) familiar with how that function works, so I had
> not considered it. I'll look into it.

Actually please not yet - I guess at some point I'll have to add devm_*
variants for input_device_* operations but for now I prefer not to mix
the 2 styles of managing resources.

BTW, I think I need to redo a few patches so I plan on folding this fix
into the original change.

Thanks.
 
-- 
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ