Re: [PATCH] iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()

2012-08-08 Thread Alexey Khoroshilov
On 08/08/2012 11:17 AM, Peter Meerwald wrote: >> Do not leak memory by updating pointer with potentially >> NULL realloc return value. > I agree > > use of krealloc() was suggested in driver review (see > http://www.spinics.net/lists/linux-iio/msg05930.html) to shorten the code; > unfortunately,

Re: [PATCH] iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()

2012-08-08 Thread Lars-Peter Clausen
On 08/08/2012 09:17 AM, Peter Meerwald wrote: > >> Do not leak memory by updating pointer with potentially >> NULL realloc return value. > > I agree > > use of krealloc() was suggested in driver review (see > http://www.spinics.net/lists/linux-iio/msg05930.html) to shorten the code; > unfortun

Re: [PATCH] iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()

2012-08-08 Thread Peter Meerwald
> Do not leak memory by updating pointer with potentially > NULL realloc return value. I agree use of krealloc() was suggested in driver review (see http://www.spinics.net/lists/linux-iio/msg05930.html) to shorten the code; unfortunately, I misunderstood the semantics of krealloc() in case al

[PATCH] iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode()

2012-08-07 Thread Alexey Khoroshilov
Do not leak memory by updating pointer with potentially NULL realloc return value. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/iio/light/adjd_s311.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --g