Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173886
b: refs/heads/master
c: 1b8bbb3
h: refs/heads/master
v: v3
  • Loading branch information
David Ellingsworth authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent b392ea1 commit 498cb4d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7a7d92e061ed13052d306cadad6972d52acea931
refs/heads/master: 1b8bbb3c0a719f3baac22ea4a7eb1d636383ba3b
27 changes: 16 additions & 11 deletions trunk/drivers/media/radio/radio-mr800.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,30 +689,29 @@ static int usb_amradio_probe(struct usb_interface *intf,
{
struct amradio_device *radio;
struct v4l2_device *v4l2_dev;
int retval;
int retval = 0;

radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL);

if (!radio) {
dev_err(&intf->dev, "kmalloc for amradio_device failed\n");
return -ENOMEM;
retval = -ENOMEM;
goto err;
}

radio->buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL);

if (!radio->buffer) {
dev_err(&intf->dev, "kmalloc for radio->buffer failed\n");
kfree(radio);
return -ENOMEM;
retval = -ENOMEM;
goto err_nobuf;
}

v4l2_dev = &radio->v4l2_dev;
retval = v4l2_device_register(&intf->dev, v4l2_dev);
if (retval < 0) {
dev_err(&intf->dev, "couldn't register v4l2_device\n");
kfree(radio->buffer);
kfree(radio);
return retval;
goto err_v4l2;
}

strlcpy(radio->videodev.name, v4l2_dev->name,
Expand All @@ -736,14 +735,20 @@ static int usb_amradio_probe(struct usb_interface *intf,
radio_nr);
if (retval < 0) {
dev_err(&intf->dev, "could not register video device\n");
v4l2_device_unregister(v4l2_dev);
kfree(radio->buffer);
kfree(radio);
return -EIO;
goto err_vdev;
}

usb_set_intfdata(intf, radio);
return 0;

err_vdev:
v4l2_device_unregister(v4l2_dev);
err_v4l2:
kfree(radio->buffer);
err_nobuf:
kfree(radio);
err:
return retval;
}

static int __init amradio_init(void)
Expand Down

0 comments on commit 498cb4d

Please sign in to comment.