Skip to content
Commit 63306de0 authored by Geordan Neukum's avatar Geordan Neukum Committed by Greg Kroah-Hartman
Browse files

staging: kpc2000: kpc_i2c: prevent memory leak in probe() error case



The probe() function performs a kzalloc to dynamically allocate memory
at runtime. If the allocation succeeds, yet invoking the function
i2c_add_adapter fails, the dynamically allocated memory is never freed.
Change the allocation to use the managed allocation API instead and
remove the manual freeing of the memory in the remove() function.

Signed-off-by: default avatarGeordan Neukum <gneukum1@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 11011c03
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment