From patchwork Fri Aug 12 11:40:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 1060852 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7CBeOot031293 for ; Fri, 12 Aug 2011 11:40:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754100Ab1HLLkR (ORCPT ); Fri, 12 Aug 2011 07:40:17 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:46815 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751587Ab1HLLkP (ORCPT ); Fri, 12 Aug 2011 07:40:15 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 57C9A19BCDE; Fri, 12 Aug 2011 13:40:14 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 12041-17; Fri, 12 Aug 2011 13:40:09 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id 4362919BC9A; Fri, 12 Aug 2011 13:40:09 +0200 (CEST) From: Julia Lawall To: Antoine Jacquet Cc: kernel-janitors@vger.kernel.org, Mauro Carvalho Chehab , 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 13:40:08 +0200 Message-Id: <1313149208-7368-1-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Fri, 12 Aug 2011 11:40:24 +0000 (UTC) From: Julia Lawall 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 --- 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(+) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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; }