Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2231595rwi; Tue, 1 Nov 2022 05:33:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6OayA4oEro5UV2n7o6VX2bcVvjfww9N6BJmPSY873WhCpn36eoOFJItcnDgAJX9FV7HsuX X-Received: by 2002:a63:e211:0:b0:43b:f03e:3cc5 with SMTP id q17-20020a63e211000000b0043bf03e3cc5mr17120369pgh.256.1667305989397; Tue, 01 Nov 2022 05:33:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667305989; cv=none; d=google.com; s=arc-20160816; b=VohL7rgLQLsBmymNlJr9A9hTGAoA6ag1gKxrezlz7MyYflImFFjPb8tvsKN05Esic8 sVnas8KFPYbRb8njBTxs7dztcoQUPdpTD6Er1GjsSo7XFeNPU3Yeqy7GmwzwY3IMGcfy JzPbTP+MA18zGgIaKjl5/SL3UsGWs6MyWvZUmmTD2DcD+5R2qItW/FfbRsKEbdg583sZ G8H4AajFCN+/AC/U9IDugHQHx0ugtJynRo3XfrIWl1N0471Cg9wa4q7i6sBhPA4l6WeK r0vCjAjtiIP7hxHa5kQGbKqakWgnjRpK09zEWrVMAL/ZoodoEgqcN4qxboSvpwfMMG2Z xVPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IS1n2f6T37/VhYWOpRohPncUcGntrEzrvH4af8SHzYo=; b=dKePNkFwIdnhqPbBTBr59epfYjRnu75esKY5qXxK4SqMEcQizIvhACUivlSnf11BgH WpRIiLnam7CSl3+E9SfscXauak8MuJ/LOkpmlVsW68XrwqtSt4ZRndgYK/vKemdpYpEy X/Y84gH4xmN+Ywm7JuhzSLqg3Wcn2ztl0PZSttRE526YfwDYALNCYoT0yTe6U97V0FQ6 CV2N/hCYCZ5mzr0uHsVYYswD+G9p7th9QXQDTx3+ZywUybxJ6PB4Ycx+zVcgGxIYbTZZ hOC8wEOxdy8Bth3gJItejoqtsF3D1++cIcLguHt6gbmqCzFQ79P6iLREZr0p6OF6kKn2 4A/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t41498uO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i70-20020a639d49000000b0046f5e5d7310si13349750pgd.828.2022.11.01.05.32.56; Tue, 01 Nov 2022 05:33:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t41498uO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230266AbiKAL31 (ORCPT + 97 others); Tue, 1 Nov 2022 07:29:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbiKAL21 (ORCPT ); Tue, 1 Nov 2022 07:28:27 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3019E1A056; Tue, 1 Nov 2022 04:28:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E2107B81CC1; Tue, 1 Nov 2022 11:28:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A8E0C433C1; Tue, 1 Nov 2022 11:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1667302089; bh=IQWnML7R5rhFY2oavhDQX27l1tZcyVC5nL2ZXOPK5tc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t41498uOZCJ/Ax089/oKNvKpllDmE7HDEj7Hdw88iuzsnjVFbIKqfeMSixUi/ONZs VxZp6XG0WcBsqD6N59XGp2By5b4lb5sGtBo272w8VcvxHOfUo4HlKgp2BneRdcEfO6 A0WWu6PResHLKOh7zXqP/RbspNKI5ltYa4t9TnPd3l9cl2SZb3edehff0j9cd0aKtd DaOJB+UjlCLKy6VPUqWoiKE1Y6Mp20LBmSUs57+GWpkRRdfi+XH0JvMOKFOXKlMQmu skKQ1jxpXPaQyBcACEnnyAfi3SXk84BffZLoxYM1gtJimzZTav1v0XS2/y6UFMMw21 YqLx5V5S1EreA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , Andy Shevchenko , Mauro Carvalho Chehab , Sasha Levin , gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com, kitakar@gmail.com, alan@linux.intel.com, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH AUTOSEL 6.0 18/34] media: atomisp: Fix v4l2_fh resource leak on open errors Date: Tue, 1 Nov 2022 07:27:10 -0400 Message-Id: <20221101112726.799368-18-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221101112726.799368-1-sashal@kernel.org> References: <20221101112726.799368-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 5b9853ad1329be49343a608d574eb232ff1273d0 ] When atomisp_open() fails then it must call v4l2_fh_release() to undo the results of v4l2_fh_open(). Reviewed-by: Andy Shevchenko Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/atomisp/pci/atomisp_fops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index 77150e4ae144..92cbc0e263e8 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -903,6 +903,7 @@ static int atomisp_open(struct file *file) pm_runtime_put(vdev->v4l2_dev->dev); error: rt_mutex_unlock(&isp->mutex); + v4l2_fh_release(file); return ret; } -- 2.35.1