Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8871c85d authored by Daniel Mack's avatar Daniel Mack Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB: drivers/media/dvb/dvb-usb/dib0700: fix return values



Propagte correct error values instead of returning -1 which just means
-EPERM ("Permission denied")

Signed-off-by: default avatarDaniel Mack <daniel@caiaq.de>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 4c61f678
Loading
Loading
Loading
Loading
+7 −9
Original line number Original line Diff line number Diff line
@@ -640,10 +640,10 @@ int dib0700_rc_setup(struct dvb_usb_device *d)
		return 0;
		return 0;


	/* Set the IR mode */
	/* Set the IR mode */
	i = dib0700_ctrl_wr(d, rc_setup, 3);
	i = dib0700_ctrl_wr(d, rc_setup, sizeof(rc_setup));
	if (i < 0) {
	if (i < 0) {
		err("ir protocol setup failed");
		err("ir protocol setup failed");
		return -1;
		return i;
	}
	}


	if (st->fw_version < 0x10200)
	if (st->fw_version < 0x10200)
@@ -653,14 +653,14 @@ int dib0700_rc_setup(struct dvb_usb_device *d)
	purb = usb_alloc_urb(0, GFP_KERNEL);
	purb = usb_alloc_urb(0, GFP_KERNEL);
	if (purb == NULL) {
	if (purb == NULL) {
		err("rc usb alloc urb failed\n");
		err("rc usb alloc urb failed\n");
		return -1;
		return -ENOMEM;
	}
	}


	purb->transfer_buffer = kzalloc(RC_MSG_SIZE_V1_20, GFP_KERNEL);
	purb->transfer_buffer = kzalloc(RC_MSG_SIZE_V1_20, GFP_KERNEL);
	if (purb->transfer_buffer == NULL) {
	if (purb->transfer_buffer == NULL) {
		err("rc kzalloc failed\n");
		err("rc kzalloc failed\n");
		usb_free_urb(purb);
		usb_free_urb(purb);
		return -1;
		return -ENOMEM;
	}
	}


	purb->status = -EINPROGRESS;
	purb->status = -EINPROGRESS;
@@ -669,12 +669,10 @@ int dib0700_rc_setup(struct dvb_usb_device *d)
			  dib0700_rc_urb_completion, d);
			  dib0700_rc_urb_completion, d);


	ret = usb_submit_urb(purb, GFP_ATOMIC);
	ret = usb_submit_urb(purb, GFP_ATOMIC);
	if (ret != 0) {
	if (ret)
		err("rc submit urb failed\n");
		err("rc submit urb failed\n");
		return -1;
	}


	return 0;
	return ret;
}
}


static int dib0700_probe(struct usb_interface *intf,
static int dib0700_probe(struct usb_interface *intf,