From: Alexey Khoroshilov Date: Wed, 8 Aug 2012 09:58:00 +0000 (+0100) Subject: iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode() X-Git-Tag: v3.6-rc3~38^2^2~13 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c795ebd00042b3a5c97e049fd1c08763714a7a8;p=pandora-kernel.git iio/adjd_s311: Fix potential memory leak in adjd_s311_update_scan_mode() Do not leak memory by updating pointer with potentially NULL realloc return value. There is no need to preserve data in the buffer, so replace krealloc() by kfree()-kmalloc() pair. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov Acked-by: Peter Meerwald Signed-off-by: Jonathan Cameron --- Reading git-diff-tree failed