Skip to content
Commit f4706b84 authored by Mark Greer's avatar Mark Greer Committed by Greg Kroah-Hartman
Browse files

greybus: gb-audio: Ensure i2c adapter struct exists before using



The current audio code uses i2c_get_adapter() without checking
that a non-NULL pointer is returned (i.e., that the i2c device
actually exists).  When that happens, the system panics.
Fix the potential panic by erroring out with -ENODEV when
i2c_get_adapter() returns NULL.

CC: John Stultz <john.stultz@linaro.com>
Signed-off-by: default avatarMark Greer <mgreer@animalcreek.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 86f918ee
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment