From patchwork Thu Dec 1 04:50:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: shailendra.v@samsung.com X-Patchwork-Id: 9455373 X-Patchwork-Delegate: geert@linux-m68k.org 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 A569860235 for ; Thu, 1 Dec 2016 04:53:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BB6F2849F for ; Thu, 1 Dec 2016 04:53:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9092F284C8; Thu, 1 Dec 2016 04:53: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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 B7F772849F for ; Thu, 1 Dec 2016 04:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756478AbcLAExO (ORCPT ); Wed, 30 Nov 2016 23:53:14 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:43080 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755402AbcLAExA (ORCPT ); Wed, 30 Nov 2016 23:53:00 -0500 Received: from epcpsbgm1new.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OHH02H6EPK2T4C0@mailout4.samsung.com>; Thu, 01 Dec 2016 13:52:56 +0900 (KST) X-AuditID: cbfee61a-f79916d0000062de-9f-583faca8fec4 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id F5.90.25310.8ACAF385; Thu, 1 Dec 2016 13:52:56 +0900 (KST) Received: from localhost.localdomain ([107.108.168.37]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OHH00AUFPJGHV20@mmp1.samsung.com>; Thu, 01 Dec 2016 13:52:56 +0900 (KST) From: Shailendra Verma To: Mauro Carvalho Chehab , Laurent Pinchart , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Shailendra Verma , Shailendra Verma Cc: vidushi.koul@samsung.com Subject: [PATCH] Platform: vsp1: Clean up file handle in open() error path. Date: Thu, 01 Dec 2016 10:20:18 +0530 Message-id: <1480567818-13363-1-git-send-email-shailendra.v@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBLMWRmVeSWpSXmKPExsVy+t9jAd0Va+wjDBZPFrHonLiE3eLyrjls Fj0btrJabH35jsli2aY/TBa35s1ks1j07RWzxd+Ll9gcODx2zrrL7jG7Yyarx6ZVnWwefVtW MXp83iQXwBrlZpORmpiSWqSQmpecn5KZl26rFBripmuhpJCXmJtqqxSh6xsSpKRQlphTCuQZ GaABB+cA92AlfbsEt4zb+w8yFuxhrVjx8j5LA+NZli5GTg4JAROJ7u2zWCFsMYkL99azdTFy cQgJLGWUOPjiMRNIQkjgJ6PEsa/qIDabgKHE676/YHERgTVMEr03hUBsZgEZiX0T28DiwgLe EnfnN4PZLAKqEi1TPzCD2LwCHhJPFk8HWsABtExBYs4kmwmM3AsYGVYxSqQWJBcUJ6XnGual lusVJ+YWl+al6yXn525iBIfqM6kdjAd3uR9iFOBgVOLhXRBnHyHEmlhWXJl7iFGCg1lJhNd2 NVCINyWxsiq1KD++qDQntfgQoynQ/onMUqLJ+cA4yiuJNzQxNzE3NrAwt7Q0MVIS522c/Sxc SCA9sSQ1OzW1ILUIpo+Jg1OqgTFNQCAonbm8lSWGz+5uRUTvIr0J550UTjXbs/vs+cMcvqZX TLiV0Vq56arZts/xwsx3VRct9lX9bri+fsXenc+Xp7ZYTFCWYNr1Z5tUU8rkpXsniuRdcTRa +slMtGKThPXhwxPPt0VtFrFesm2OhprzN6VVpv4fPNZqWC6M2La2W9ue/cLOVUosxRmJhlrM RcWJAJtrd5drAgAA X-MTR: 20000000000000000@CPGS Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP v4l2_fh_init is already done.So call the v4l2_fh_exit in error condition before returing from the function. Signed-off-by: Shailendra Verma Reviewed-by: Laurent Pinchart --- drivers/media/platform/vsp1/vsp1_video.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/vsp1/vsp1_video.c b/drivers/media/platform/vsp1/vsp1_video.c index d351b9c..cc58163 100644 --- a/drivers/media/platform/vsp1/vsp1_video.c +++ b/drivers/media/platform/vsp1/vsp1_video.c @@ -1044,6 +1044,7 @@ static int vsp1_video_open(struct file *file) ret = vsp1_device_get(video->vsp1); if (ret < 0) { v4l2_fh_del(vfh); + v4l2_fh_exit(vfh); kfree(vfh); }