]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
greybus: gb-audio: Ensure i2c adapter struct exists before using
authorMark Greer <mgreer@animalcreek.com>
Fri, 26 Jun 2015 23:38:46 +0000 (16:38 -0700)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 30 Jun 2015 01:04:38 +0000 (18:04 -0700)
commitf4706b848ec6c58f797604112d30272db8d5e8dd
tree6d629de81136b4dbf5e755698414f19665c26d18
parent86f918ee7f941c383ee32ad28dca6e48a04b6074
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: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/audio.c