Skip to content
Commit 1c795ebd authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Jonathan Cameron
Browse files

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Acked-by: default avatarPeter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 8857df3a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment