Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp180027rwi; Wed, 12 Oct 2022 18:12:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Kyinyxinlm/sXa2A3ORiyR8CuNeOwK8rD/BB5FrxPoJgHVxDELdKEJ019frB0Z70ZQaQe X-Received: by 2002:a17:90b:17d2:b0:20d:6c68:6df8 with SMTP id me18-20020a17090b17d200b0020d6c686df8mr7865047pjb.54.1665623554160; Wed, 12 Oct 2022 18:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665623554; cv=none; d=google.com; s=arc-20160816; b=UjjWt3HeiE4EZi5POd6S/uY97EelG4iFA/0JfMUK9rTbuieM0E4LEMHiJ8P70mFWtn XqSXN++iEApyqzwEq8iMvbWRupyfZVBMwzDO5ObwRbRG4cTKsvStlO0/EVTn3TAFXmzX 9gy5LWiR11San/8f9f5WOqmEElsBf7gFS9uuLVawarItGmZqdwu5hprij74iQos3zXpg G8pvmhjH6dq5aWc6CnhZW7j+Mzeg9tidZKHqfAdDQHR5YK8pwhbwhw3tXDUmL1wXBeLx Nq7JI7liXq0xFh+YczZHnNfGYCZ+kLKKWKdeTPkT0NsAIV78d2MEb9RkMffXMK093153 nOhQ== 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=ONzs0fVmve/S5ghcbzdDMuQ75IIJkGqSlNozVFCWB0E=; b=lu6yqYtn4TAjnSe7Hb0DHQgNWpuIxj58PGb7UWsNtYjNNnQTqwIEjiBQJGALoaYCjw 3elJUokxz+NwtDZcFNtyYkyveen2TLU1Pa8U9JgdJdc3AqMXU8L1gPeRjhUJJjk7tOEC 5waWA693r/s+oHS/13ke9iwdIJcFwaY3UsLZ1W0QrPMFj5wDEyJ2B5CrAzq1F6vxY8du 4Ye01qlUsgrBeflj5MlO/PRLKTMZKUpiSDeo5wkHT4coO19ZBSDfnLex0ukSXwjEOdBt psRJUzfB+TPWRPtVqBVchkOUktvzrd/D7EelOhMo4BVuXa155u1vqMhjgRThuW0QHGxk cOhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oJ6dHqTS; 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 y9-20020a626409000000b005618e849944si19196373pfb.156.2022.10.12.18.12.21; Wed, 12 Oct 2022 18:12:34 -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=oJ6dHqTS; 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 S229772AbiJMAQU (ORCPT + 99 others); Wed, 12 Oct 2022 20:16:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbiJMAQN (ORCPT ); Wed, 12 Oct 2022 20:16:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AAEBD9952; Wed, 12 Oct 2022 17:16:11 -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 C0F00B81CBD; Thu, 13 Oct 2022 00:16:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 05167C433B5; Thu, 13 Oct 2022 00:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620168; bh=YJbnZ0RTeY+t7PcY4eYKEecQAqN2QYIiIc5b5AmosT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oJ6dHqTSlwLb9N/GHfxE2AAcsyZn9sGyBL9uSvBeFJGmoQYDfk36CDO6OXZAT3Qpk Y4rKHa39CpgSCXGfy3EAlmUzJGLoN1fXNMrjP/aa24pS/8R3F9ka2AH49NNWiy02Zz 5fcTKHZ50GeKHUF3e0qVY1ettdZoXkcPhLGRgeRP2UTtCMjCLMmbQaCmrkWq3aCRby dQAxtQ81ixSzT5UEc4xmQW5oBQcrPaKNkxsn+ECFBZ+XkIMU7P4knttRWKNsMUS8FA xD5P7emQMyMMpT+cKe13UwlsGoY01cSuq+fzLN1AwVYf0Iv+pJVJIBbPvzXClSkHn/ pFXJjwfeF8zHg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hangyu Hua , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin , neil.armstrong@linaro.org, khilman@baylibre.com, bin.liu@mediatek.com, matthias.bgg@gmail.com, m.szyprowski@samsung.com, andrzej.hajda@intel.com, linux-media@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 6.0 04/67] media: platform: fix some double free in meson-ge2d and mtk-jpeg and s5p-mfc Date: Wed, 12 Oct 2022 20:14:45 -0400 Message-Id: <20221013001554.1892206-4-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: Hangyu Hua [ Upstream commit c65c3f3a2cbf21ed429d9b9c725bdb5dc6abf4cf ] video_unregister_device will release device internally. There is no need to call video_device_release after video_unregister_device. Signed-off-by: Hangyu Hua Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/amlogic/meson-ge2d/ge2d.c | 1 - drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 1 - drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c index 5e7b319f300d..142d421a8d76 100644 --- a/drivers/media/platform/amlogic/meson-ge2d/ge2d.c +++ b/drivers/media/platform/amlogic/meson-ge2d/ge2d.c @@ -1030,7 +1030,6 @@ static int ge2d_remove(struct platform_device *pdev) video_unregister_device(ge2d->vfd); v4l2_m2m_release(ge2d->m2m_dev); - video_device_release(ge2d->vfd); v4l2_device_unregister(&ge2d->v4l2_dev); clk_disable_unprepare(ge2d->clk); diff --git a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c index 87685a62a5c2..3071b61946c3 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1414,7 +1414,6 @@ static int mtk_jpeg_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); video_unregister_device(jpeg->vdev); - video_device_release(jpeg->vdev); v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); diff --git a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c index 761341934925..f85d1eebafac 100644 --- a/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c @@ -1399,6 +1399,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) /* Deinit MFC if probe had failed */ err_enc_reg: video_unregister_device(dev->vfd_dec); + dev->vfd_dec = NULL; err_dec_reg: video_device_release(dev->vfd_enc); err_enc_alloc: @@ -1444,8 +1445,6 @@ 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_unconfigure_dma_memory(dev); -- 2.35.1