From patchwork Thu Jun 9 01:35:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuah Khan X-Patchwork-Id: 9166119 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 86A1A60572 for ; Thu, 9 Jun 2016 01:35:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78B9F2766D for ; Thu, 9 Jun 2016 01:35:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D5D428294; Thu, 9 Jun 2016 01:35:48 +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 268022766D for ; Thu, 9 Jun 2016 01:35:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932497AbcFIBfI (ORCPT ); Wed, 8 Jun 2016 21:35:08 -0400 Received: from resqmta-po-01v.sys.comcast.net ([96.114.154.160]:59138 "EHLO resqmta-po-01v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752915AbcFIBfH (ORCPT ); Wed, 8 Jun 2016 21:35:07 -0400 Received: from resomta-po-17v.sys.comcast.net ([96.114.154.241]) by resqmta-po-01v.sys.comcast.net with SMTP id Aorxbn1UekzylAosDbKeeE; Thu, 09 Jun 2016 01:35:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1465436105; bh=yIwnhzl/Huff4lXs8e6kvTsRD6LgzbYnbq6Bn5LdnOo=; h=Received:Received:Received:From:To:Subject:Date:Message-Id; b=JNPECgEn+/CWqW2f1/VUtlG9yYjX2dFfQkWkXE7xoYVmytMMnTc68Pkl5ZB+FSdC+ CPOYAH8tFDqc7VlnFglSn9EYUgw4pSWGi04kkx1F4uAM6XxS4O6+I/y9xLBPlwV/cY mENZUoM4G1R2k0cxh6Fkr6JfXDP04h10PpV16CWiIwlUkoz3WRiktK8s+zWpk92BQU m6eG8Pv9s9Mi9OBdzPQjfGff7DmmXYygmFLpYzu4RsounxpAdE4i/1M9i30Adve2Hn nQR4eeP9CiIklVl774n9ZAFOM7Vr0MTWmVimIF875zpMcU9inD06TXa10+tQwxWZMv wMVmB82l9BDxw== Received: from mail.gonehiking.org ([73.181.52.62]) by resomta-po-17v.sys.comcast.net with comcast id 4Rb41t00H1LXgTt01Rb443; Thu, 09 Jun 2016 01:35:05 +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 19EB39F301; Wed, 8 Jun 2016 19:35:04 -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 video device release double release in probe error path Date: Wed, 8 Jun 2016 19:35:02 -0600 Message-Id: <1465436102-13827-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 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 Reviewed-by: Javier Martinez Canillas --- 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,