Re: [PATCH] Input: omap4-keypad - don't leak in omap4_keypad_probe()

From
Jesper Juhl <hidden>
Date
2012-08-08 19:36:57
Also in
lkml
Reply to
Sachin Kamat, 2012-08-08
On Wed, 8 Aug 2012, Sachin Kamat wrote:
On 7 August 2012 23:46, Jesper Juhl [off-list ref] wrote:
quoted
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.

-- 
Jesper Juhl [off-list ref]       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
Thread (5 messages) 5 messages, 3 authors, last reply 2012-08-08
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help