Re: [PATCH] gpiolib: free device name on error path to fix kmemleak

2021-02-01 Thread Andy Shevchenko
On Mon, Feb 1, 2021 at 5:50 PM Bartosz Golaszewski wrote: > > On Sat, Jan 30, 2021 at 4:45 AM quanyang.wang > wrote: > > > > Hi Andy, > > > > On 1/30/21 1:26 AM, Andy Shevchenko wrote: > > > On Fri, Jan 29, 2021 at 2:01 PM wrote: > > >> From: Quanyang Wang > > >> > > >> In

Re: [PATCH] gpiolib: free device name on error path to fix kmemleak

2021-02-01 Thread Bartosz Golaszewski
On Sat, Jan 30, 2021 at 4:45 AM quanyang.wang wrote: > > Hi Andy, > > On 1/30/21 1:26 AM, Andy Shevchenko wrote: > > On Fri, Jan 29, 2021 at 2:01 PM wrote: > >> From: Quanyang Wang > >> > >> In gpiochip_add_data_with_key, we should check the return value of > >> dev_set_name to ensure that

Re: [PATCH] gpiolib: free device name on error path to fix kmemleak

2021-01-29 Thread quanyang.wang
Hi Andy, On 1/30/21 1:26 AM, Andy Shevchenko wrote: On Fri, Jan 29, 2021 at 2:01 PM wrote: From: Quanyang Wang In gpiochip_add_data_with_key, we should check the return value of dev_set_name to ensure that device name is allocated successfully and then add a label on the error path to free

Re: [PATCH] gpiolib: free device name on error path to fix kmemleak

2021-01-29 Thread Andy Shevchenko
On Fri, Jan 29, 2021 at 2:01 PM wrote: > > From: Quanyang Wang > > In gpiochip_add_data_with_key, we should check the return value of > dev_set_name to ensure that device name is allocated successfully > and then add a label on the error path to free device name to fix > kmemleak as below:

[PATCH] gpiolib: free device name on error path to fix kmemleak

2021-01-29 Thread quanyang . wang
From: Quanyang Wang In gpiochip_add_data_with_key, we should check the return value of dev_set_name to ensure that device name is allocated successfully and then add a label on the error path to free device name to fix kmemleak as below: unreferenced object 0xc2d6fc40 (size 64): comm