From patchwork Tue Jun 28 19:17:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9203869 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 3D4B260B17 for ; Tue, 28 Jun 2016 19:17:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A62328615 for ; Tue, 28 Jun 2016 19:17:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 150312861C; Tue, 28 Jun 2016 19:17:56 +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 67B962861B for ; Tue, 28 Jun 2016 19:17:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752557AbcF1TRr (ORCPT ); Tue, 28 Jun 2016 15:17:47 -0400 Received: from resqmta-po-03v.sys.comcast.net ([96.114.154.162]:56290 "EHLO resqmta-po-03v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752202AbcF1TRW (ORCPT ); Tue, 28 Jun 2016 15:17:22 -0400 Received: from resomta-po-09v.sys.comcast.net ([96.114.154.233]) by resqmta-po-03v.sys.comcast.net with SMTP id HyVWbX4y0RfBzHyVdbDIU3; Tue, 28 Jun 2016 19:17:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1467141441; bh=yIwnhzl/Huff4lXs8e6kvTsRD6LgzbYnbq6Bn5LdnOo=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=YdCAF8wMWCgi1n8busBjkdHmPf5ztJZR0x4/PPzjdjy3LHe1RaHvRjV5UoK0VzfVR 8VBoEjFK0VVyYViNLCaqimSl9avPy5IUqVx9ejI09X6mdHdMcqxUIm6RSuCYWV7S6n Zc3aZ6eiOOF3cIMa7dtt+THPpaROcEgGZsrR413B9GicX4U9FeXoCUuRGe7ostS7QP WIlz6h6UcmA2vsgP52evXJkkAMb6DM4ZpAq4v95HX2BDUwZ39nfftQlZaIwyL+uetA Ygdo2ePjHZmdg56fBmZXmYRzHUlZQOWuZc5LxU89pxD23J9Va9L2su7rQMXerJT5XN haXKeSKMx4BoQ== Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-09v.sys.comcast.net with comcast id CKHL1t00T1LXgTt01KHLsz; Tue, 28 Jun 2016 19:17:21 +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 66DBD9F4C8; Tue, 28 Jun 2016 13:17:20 -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 REBASE 1/3] media: s5p-mfc fix video device release double release in probe error path Date: Tue, 28 Jun 2016 13:17:16 -0600 Message-Id: <97b8e5a8e26d758762ce0d22212284ca6a0a3ac2.1467140929.git.shuahkh@osg.samsung.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: 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 Fix Decoder and encoder video device double release in probe error path. video_device_release(dev->vfd_dec) get called twice if decoder register fails. Also, video_device_release(dev->vfd_enc) get called twice if encoder register fails. Signed-off-by: Shuah Khan --- drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index 6ee620e..274b4f1 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1266,7 +1266,6 @@ static int s5p_mfc_probe(struct platform_device *pdev) ret = video_register_device(dev->vfd_dec, VFL_TYPE_GRABBER, 0); if (ret) { v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); - video_device_release(dev->vfd_dec); goto err_dec_reg; } v4l2_info(&dev->v4l2_dev, @@ -1275,7 +1274,6 @@ static int s5p_mfc_probe(struct platform_device *pdev) ret = video_register_device(dev->vfd_enc, VFL_TYPE_GRABBER, 0); if (ret) { v4l2_err(&dev->v4l2_dev, "Failed to register video device\n"); - video_device_release(dev->vfd_enc); goto err_enc_reg; } v4l2_info(&dev->v4l2_dev,