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 <mche...@s-opensource.com>
---

v2: simplify the logic and use its own error message.


 drivers/media/usb/dvb-usb/pctv452e.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/usb/dvb-usb/pctv452e.c 
b/drivers/media/usb/dvb-usb/pctv452e.c
index 855fe9d34b59..f70202e6e3eb 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;
+       };
 
        id = state->c++;
 
-- 
2.7.4


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to