diff options
author | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-07 14:15:53 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-14 12:47:13 -0300 |
commit | 5dfd2c8f263dfcaf614d24734f0af8c1c18a9ca8 (patch) | |
tree | 4cb4c0e06e59a415f1dce71bc8f6704edb1c9040 | |
parent | 73d5c5c864f4094e86708760fd4612fbf1e6e76c (diff) | |
download | op-kernel-dev-5dfd2c8f263dfcaf614d24734f0af8c1c18a9ca8.zip op-kernel-dev-5dfd2c8f263dfcaf614d24734f0af8c1c18a9ca8.tar.gz |
[media] pctv452e: don't call BUG_ON() on non-fatal error
There are some conditions on this driver that are tested with
BUG_ON() with are not serious enough to hang a machine.
So, just return an error if this happens.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/usb/dvb-usb/pctv452e.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/usb/dvb-usb/pctv452e.c b/drivers/media/usb/dvb-usb/pctv452e.c index 58b6850..7ad0006 100644 --- a/drivers/media/usb/dvb-usb/pctv452e.c +++ b/drivers/media/usb/dvb-usb/pctv452e.c @@ -109,9 +109,10 @@ static int tt3650_ci_msg(struct dvb_usb_device *d, u8 cmd, u8 *data, unsigned int rlen; int ret; - BUG_ON(NULL == data && 0 != (write_len | read_len)); - BUG_ON(write_len > 64 - 4); - BUG_ON(read_len > 64 - 4); + if (!data || (write_len > 64 - 4) || (read_len > 64 - 4)) { + err("%s: transfer data invalid", __func__); + return -EIO; + }; mutex_lock(&state->ca_mutex); id = state->c++; |