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: 9174231 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 8EDC06044F for ; Mon, 13 Jun 2016 19:51:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FB5E2040D for ; Mon, 13 Jun 2016 19:51:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 747F3262AE; Mon, 13 Jun 2016 19:51:38 +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 B1BCB2040D for ; Mon, 13 Jun 2016 19:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423132AbcFMTpU (ORCPT ); Mon, 13 Jun 2016 15:45:20 -0400 Received: from resqmta-po-01v.sys.comcast.net ([96.114.154.160]:35934 "EHLO resqmta-po-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161291AbcFMTpS (ORCPT ); Mon, 13 Jun 2016 15:45:18 -0400 Received: from resomta-po-13v.sys.comcast.net ([96.114.154.237]) by resqmta-po-01v.sys.comcast.net with SMTP id CXkibtYlDkzylCXnRbVGXU; 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=gscgsjvQzhpn38idQHlNH5axPFyZ/43Xh+16y66HTss/vB1gXi+Pwk46G2dNptxTT aQay+6COepznDVRNEGP+k3qUuBRFMJYgAs9/jnSzoE8lOxxghm7RG3A/oePGxjDtYT sQPw1AFeBJqZB5q1iQdZcoDUvUU8gzSuKw0L64YtAi/3l2/Hdhj2KQj8cSBayf2uB9 rKYkS5Va6cN6EFo4HMeO7ZQ7zgWE2hhfoU5dmgrzqPPwndz6WdqL6XgLqkFjte7QY5 KAME+G0jFRDngdWLzQ5Pjb+FzTh+xW72fOZbM00be82odYwa5vsxXwtbd/nOBf+0yN 1kvvVHKvynBkw== 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 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: 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 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 --- 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]);