From: Julia Lawall <julia@diku.dk>
To: Antoine Jacquet <royale@zerezo.com>
Cc: kernel-janitors@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@infradead.org>,
linux-usb@vger.kernel.org, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] drivers/media/video/zr364xx.c: add missing cleanup code
Date: Fri, 12 Aug 2011 11:40:08 +0000 [thread overview]
Message-ID: <1313149208-7368-1-git-send-email-julia@diku.dk> (raw)
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;
}
reply other threads:[~2011-08-12 11:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313149208-7368-1-git-send-email-julia@diku.dk \
--to=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=royale@zerezo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox