Commit 5dfd2c8f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 73d5c5c8
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -109,9 +109,10 @@ static int tt3650_ci_msg(struct dvb_usb_device *d, u8 cmd, u8 *data,
	unsigned int rlen;
	unsigned int rlen;
	int ret;
	int ret;


	BUG_ON(NULL == data && 0 != (write_len | read_len));
	if (!data || (write_len > 64 - 4) || (read_len > 64 - 4)) {
	BUG_ON(write_len > 64 - 4);
		err("%s: transfer data invalid", __func__);
	BUG_ON(read_len > 64 - 4);
		return -EIO;
	};


	mutex_lock(&state->ca_mutex);
	mutex_lock(&state->ca_mutex);
	id = state->c++;
	id = state->c++;