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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 8 Aug 2012, Sachin Kamat wrote:

> On 7 August 2012 23:46, Jesper Juhl <jj@xxxxxxxxxxxxx> 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.

-- 
Jesper Juhl <jj@xxxxxxxxxxxxx>       http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux