lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1313149208-7368-1-git-send-email-julia@diku.dk>
Date:	Fri, 12 Aug 2011 13:40:08 +0200
From:	Julia Lawall <julia@...u.dk>
To:	Antoine Jacquet <royale@...ezo.com>
Cc:	kernel-janitors@...r.kernel.org,
	Mauro Carvalho Chehab <mchehab@...radead.org>,
	linux-usb@...r.kernel.org, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] drivers/media/video/zr364xx.c: add missing cleanup code

From: Julia Lawall <julia@...u.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@...u.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;
 	}
 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ