From patchwork Mon Jun 13 19:45:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9174201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EF7CA6044F for ; Mon, 13 Jun 2016 19:47:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C27B41FF12 for ; Mon, 13 Jun 2016 19:47:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B768122064; Mon, 13 Jun 2016 19:47:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5169A1FF12 for ; Mon, 13 Jun 2016 19:47:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCXnq-0004cy-QM; Mon, 13 Jun 2016 19:45:42 +0000 Received: from resqmta-po-12v.sys.comcast.net ([2001:558:fe16:19:96:114:154:171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1bCXno-0004V3-HT for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2016 19:45:41 +0000 Received: from resomta-po-13v.sys.comcast.net ([96.114.154.237]) by resqmta-po-12v.sys.comcast.net with SMTP id CXfybPpElGpVBCXnRbJCLZ; Mon, 13 Jun 2016 19:45:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1465847117; bh=1T2rfW9Bib3ChCHap3tsrUwq5gCOQqTX4uWRPfMoCLo=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=XGFNa8kp5tuBErFky7IbYhF0r6mLrjqLYnNGCKPkT28ryjEa2w2X+FlvG7Lf2iFAr 86WOqMd5Ud1/+3NphidAII8NO42RoxcgtvXuDQgPZmHaEcHaS4F0Cx5G0L6WRcPKE/ bmSms7zwH7gFzVU5SwExQszWtohp2SwXb5qXpThb4eNV04vKZoZlWi5bmz8z+rxZWA oskfyasPd/BbJ8DF3he6HjGihm0lTJIGUgzkShSVYvJaIQuAWw5mN1Cay5Cz70kzPZ oEGewTCT9f8aAZKrf7HoBldnugLR/h6Zwm4BEi0MX43rsrmKaiCbNCdf+3N2ge4Rg3 pIbKsIKBCR9DQ== Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-13v.sys.comcast.net with comcast id 6KlG1t00J1LXgTt01KlGWL; Mon, 13 Jun 2016 19:45:17 +0000 Received: from shuah-XPS-13-9350.sisa.samsung.com (shuah-xps.internal [192.168.1.87]) by mail.gonehiking.org (Postfix) with ESMTP id 18BA29F422; Mon, 13 Jun 2016 13:45:16 -0600 (MDT) From: Shuah Khan To: kyungmin.park@samsung.com, k.debski@samsung.com, jtp.park@samsung.com, mchehab@osg.samsung.com Subject: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove() Date: Mon, 13 Jun 2016 13:45:14 -0600 Message-Id: <1465847114-7427-1-git-send-email-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160613_124540_642963_7E2F85EE X-CRM114-Status: UNSURE ( 5.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP s5p_mfc_remove() fails to release encoder and decoder video devices. Signed-off-by: Shuah Khan Reviewed-by: Javier Martinez Canillas --- Changes since v1: - Addressed comments from Javier Martinez Canillas and added his reviewed by: drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 274b4f1..f537b74 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1318,6 +1318,8 @@ static int s5p_mfc_remove(struct platform_device *pdev) video_unregister_device(dev->vfd_enc); video_unregister_device(dev->vfd_dec); + video_device_release(dev->vfd_enc); + video_device_release(dev->vfd_dec); v4l2_device_unregister(&dev->v4l2_dev); s5p_mfc_release_firmware(dev); vb2_dma_contig_cleanup_ctx(dev->alloc_ctx[0]);