* [PATCH] drivers/media/video/zr364xx.c: add missing cleanup code
@ 2011-08-12 11:40 Julia Lawall
0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2011-08-12 11:40 UTC (permalink / raw)
To: Antoine Jacquet
Cc: kernel-janitors, Mauro Carvalho Chehab, linux-usb, linux-media,
linux-kernel
From: Julia Lawall <julia@diku.dk>
It seems just as necessary to free cam->vdev and cam in this error case as
in the next one.
Signed-off-by: Julia Lawall <julia@diku.dk>
---
There is yet another block of error handling code below the call to
zr364xx_board_init, but perhaps no cleanup code is needed in that case,
because that code is currently initializing a lock in cam?
drivers/media/video/zr364xx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c
index c492846..e78cf94 100644
--- a/drivers/media/video/zr364xx.c
+++ b/drivers/media/video/zr364xx.c
@@ -1638,6 +1638,9 @@ static int zr364xx_probe(struct usb_interface *intf,
if (!cam->read_endpoint) {
dev_err(&intf->dev, "Could not find bulk-in endpoint\n");
+ video_device_release(cam->vdev);
+ kfree(cam);
+ cam = NULL;
return -ENOMEM;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-12 11:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-12 11:40 [PATCH] drivers/media/video/zr364xx.c: add missing cleanup code Julia Lawall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox