Commit 93a24578 authored by Aditya Pakki's avatar Aditya Pakki Committed by Mauro Carvalho Chehab

media: cx231xx: replace BUG_ON with recovery code

In cx231xx_i2c_register, if dev->cx231xx_send_usb_command is NULL,
the code crashes. However, the callers in cx231xx-core are able to
handle the error without crashing. This patch fixes this issue.
Signed-off-by: default avatarAditya Pakki <pakki001@umn.edu>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 3a909680
...@@ -515,7 +515,8 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus) ...@@ -515,7 +515,8 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
{ {
struct cx231xx *dev = bus->dev; struct cx231xx *dev = bus->dev;
BUG_ON(!dev->cx231xx_send_usb_command); if (!dev->cx231xx_send_usb_command)
return -EINVAL;
bus->i2c_adap = cx231xx_adap_template; bus->i2c_adap = cx231xx_adap_template;
bus->i2c_adap.dev.parent = dev->dev; bus->i2c_adap.dev.parent = dev->dev;
......
Markdown is supported
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