From patchwork Thu Jun 9 01:35:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9166117 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 721A760572 for ; Thu, 9 Jun 2016 01:35:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 64D172766D for ; Thu, 9 Jun 2016 01:35:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59A7C28294; Thu, 9 Jun 2016 01:35:43 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 09C782766D for ; Thu, 9 Jun 2016 01:35:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933048AbcFIBfT (ORCPT ); Wed, 8 Jun 2016 21:35:19 -0400 Received: from resqmta-po-11v.sys.comcast.net ([96.114.154.170]:35357 "EHLO resqmta-ch2-11v.sys.comcast.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932909AbcFIBfS (ORCPT ); Wed, 8 Jun 2016 21:35:18 -0400 Received: from resomta-po-13v.sys.comcast.net ([96.114.154.237]) by resqmta-po-11v.sys.comcast.net with SMTP id AosKbUPixmNqqAosPbqYYO; Thu, 09 Jun 2016 01:35:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1465436117; bh=Sh9eVo4m4wg84S0ID80ModVgk6qSAdxRVM1AJCJae/Y=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=T3ZdFbatVX2H7tM/2q98rFuMGtaGjPbrxnlHapIE5jyncOG8aOfKSrkGq59crdYMp XFrjjmDVsbi6elNBLf8cs7pXhRKUUKVMG7L8IER4OfouHsOyOPw4Qrlw3GFlY+8fMe qjltoqDrXYi9AZ/ncDzkWrj5sskpuCQwXnNiM0gedHNiHM0k6clq++HZo27+HZYejv knmnN0e8YjaF+eoXS6p8xdJN8QkMTQ7PC+W4Ih5k3k9AICJs6u8bGeZUO7kid4Cjv2 uD7qxv4QhQclB+4Zq8aXQQYp8My+nyUuyoXPjhxnXpILuOr2Bv+4ediBD/syPotgGu PxSF3Qg7moqOQ== Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-13v.sys.comcast.net with comcast id 4RbG1t00D1LXgTt01RbGKK; Thu, 09 Jun 2016 01:35:16 +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 1C7999F301; Wed, 8 Jun 2016 19:35:16 -0600 (MDT) From: Shuah Khan To: kyungmin.park@samsung.com, k.debski@samsung.com, jtp.park@samsung.com, mchehab@osg.samsung.com Cc: Shuah Khan , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: s5p-mfc fix memory leak in s5p_mfc_remove() Date: Wed, 8 Jun 2016 19:35:15 -0600 Message-Id: <1465436115-13880-1-git-send-email-shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.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 --- 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..af61f54 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1317,7 +1317,9 @@ static int s5p_mfc_remove(struct platform_device *pdev) destroy_workqueue(dev->watchdog_workqueue); video_unregister_device(dev->vfd_enc); + video_device_release(dev->vfd_enc); video_unregister_device(dev->vfd_dec); + 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]);