From patchwork Fri May 30 22:20:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Khoroshilov X-Patchwork-Id: 4274251 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9B1EB9F336 for ; Fri, 30 May 2014 22:20:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DFFE42010C for ; Fri, 30 May 2014 22:20:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A35120142 for ; Fri, 30 May 2014 22:20:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932299AbaE3WUj (ORCPT ); Fri, 30 May 2014 18:20:39 -0400 Received: from mail.ispras.ru ([83.149.199.45]:41898 "EHLO mail.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754614AbaE3WUi (ORCPT ); Fri, 30 May 2014 18:20:38 -0400 Received: from localhost.localdomain (ppp91-77-216-233.pppoe.mtu-net.ru [91.77.216.233]) by mail.ispras.ru (Postfix) with ESMTPSA id 47125540151; Sat, 31 May 2014 02:20:36 +0400 (MSK) From: Alexey Khoroshilov To: Huang Shijie , Hans Verkuil , Carvalho Chehab Cc: Alexey Khoroshilov , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] [media] tlg2300: fix leak at failure path in poseidon_probe() Date: Sat, 31 May 2014 02:20:11 +0400 Message-Id: <1401488411-22458-1-git-send-email-khoroshilov@ispras.ru> X-Mailer: git-send-email 1.8.3.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Error handling code in poseidon_probe() misses usb_put_intf() and usb_put_dev(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov --- drivers/media/usb/tlg2300/pd-main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/usb/tlg2300/pd-main.c b/drivers/media/usb/tlg2300/pd-main.c index 3316caa4733b..b31f4791b8ff 100644 --- a/drivers/media/usb/tlg2300/pd-main.c +++ b/drivers/media/usb/tlg2300/pd-main.c @@ -476,6 +476,8 @@ err_audio: err_video: v4l2_device_unregister(&pd->v4l2_dev); err_v4l2: + usb_put_intf(pd->interface); + usb_put_dev(pd->udev); kfree(pd); return ret; }