Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp203124rwi; Wed, 12 Oct 2022 18:40:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WTKIEDht7DPTk59v8J5fRJ+Qr6z40NFTCdds1pcBGgxgUiS3oeUOQnAm8K09+aHswHTz6 X-Received: by 2002:a17:902:7c98:b0:17f:941a:65e0 with SMTP id y24-20020a1709027c9800b0017f941a65e0mr32273808pll.143.1665625218049; Wed, 12 Oct 2022 18:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665625218; cv=none; d=google.com; s=arc-20160816; b=frVOOX7oZhDskRMdVwPRFkHL1VJU48+3BuUILta5ff/qbm9UqZn9R4pGsDjA3yJ/oW zcvt6IQfDDTF7SK1BtzCjdMl6Za/nMljLe2Q2PKGjvMN15E4s9kiWRjbi7psRMcHbZMT K6P0whS63AkSU590/VxDOj5u5/YTBKKI4h0QTCw2zchNxush/gpfG38tcql7033LjO0d C1OO7LRou3RJ+KwcObB3fdJNfp4wUvusok5BYYvLztF/6bEhLmU8DWtMF2i4J4x76QV9 OH6qzbhipg61IcxVCIggTECcsizbjpGWyr6F1Nd9xAqMcKX0XDag6+IoRATyi6zXqikF +9PQ== 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=FMvWmbI67JqC5C59JgViedpFg9aFX60Wvv+SkOZsV4g=; b=v0wFz+WXIzViyArnDdp+C5hcT17gL/6F6GK7nUkvMpZihNc87U4YqKxHdo0s+87l0P kB8aNewg+/MFru0E7qQvXEwjLV/wvRStq0SMcApSep7O4QCmgeUtR/oYRh2pb6SYtnGl pXamJ4a7aqGxW2cYFaCertYM6zz44AvJb3knDJcPzpZoIFcLVtk9BgTzghL9ij0JlVAz 6m63xugutyoZ+C5LQJ/SUnu5T9cZh4Deyou2oIui6oOiB4Xq9XA2PNaLcy/DP7R4F9r8 5y1ypOeKwWOs1BB9M6GXSfC+ktasiu8m/aGeTVwsJvzvoDqkXhJdQIeQpNsw4ZR8sN7j tU1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n2BLZLyg; 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 i17-20020a63d451000000b00462a6f64703si12518727pgj.376.2022.10.12.18.40.04; Wed, 12 Oct 2022 18:40:18 -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=n2BLZLyg; 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 S229971AbiJMBM4 (ORCPT + 99 others); Wed, 12 Oct 2022 21:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiJMBMc (ORCPT ); Wed, 12 Oct 2022 21:12:32 -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 9DFCF11A12; Wed, 12 Oct 2022 18:11:40 -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 8D5E9B81CD8; Thu, 13 Oct 2022 00:21:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CC6FC433D6; Thu, 13 Oct 2022 00:21:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620502; bh=i1lndpiEkYrYAtQpDMBbdOudkzLK1aVb7W6EgX5Yd3A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n2BLZLyggaDgsax3xO3TQy9M+dyFbP4ZpSPjKD6trFqlic0eMh9Pp+Qfs31bGEqWV i9yl+hF79wtvVvoH4FWMQgZsqnXhkPtvwDanO+iW2H9Pi67xYKT/9TjMcFnALHPMbu EBPCYZy+/0N/Q3Joi9Ga4gA0iPRTtaJs+6vk/bVKS43SGLIImnlN7YOv+J0XZfdcOQ FlgmIXlGBMe03hkbZBhI6joIiPjcT1W+SC/ogg8Z09hkwhdNhltVrlWWmWvagNPiVu S7d+4D73pewDj/eOPfq11kmynWlHSpWFGVun1FFEsapkgv0AnYBVtSYEaaJuMLwE81 IZnVKVuC5GO/Q== 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, matthias.bgg@gmail.com, dafna.hirschfeld@collabora.com, vulab@iscas.ac.cn, rick.chang@mediatek.com, yong.wu@mediatek.com, colin.i.king@gmail.com, christophe.jaillet@wanadoo.fr, prabhakar.mahadev-lad.rj@bp.renesas.com, andrzej.hajda@intel.com, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 03/47] media: platform: fix some double free in meson-ge2d and mtk-jpeg and s5p-mfc Date: Wed, 12 Oct 2022 20:20:38 -0400 Message-Id: <20221013002124.1894077-3-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013002124.1894077-1-sashal@kernel.org> References: <20221013002124.1894077-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/meson/ge2d/ge2d.c | 1 - drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1 - drivers/media/platform/s5p-mfc/s5p_mfc.c | 3 +-- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/media/platform/meson/ge2d/ge2d.c b/drivers/media/platform/meson/ge2d/ge2d.c index a373dea9866b..a885cbc99e38 100644 --- a/drivers/media/platform/meson/ge2d/ge2d.c +++ b/drivers/media/platform/meson/ge2d/ge2d.c @@ -1032,7 +1032,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/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index a89c7b206eef..470f8f167744 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -1457,7 +1457,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); mtk_jpeg_clk_release(jpeg); diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index f336a9543273..4fc135d9f38b 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -1406,6 +1406,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: @@ -1451,8 +1452,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