Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp809073rwi; Wed, 19 Oct 2022 03:17:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7wGLlvrqcwFBOPQtPiy8qB1sOi8OEV7Re9Kp01uvSscUi7kpnysvHfH5gV1Y+7JnsQyCUB X-Received: by 2002:a17:902:e885:b0:183:dcb7:c4f8 with SMTP id w5-20020a170902e88500b00183dcb7c4f8mr7682314plg.160.1666174646944; Wed, 19 Oct 2022 03:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666174646; cv=none; d=google.com; s=arc-20160816; b=PX2B5fQGovFBQLA6zQ73ymBfU6w7MPdhPPycwdDDai8ir7C56r3XaMsn7hE3KTfUNn ISil91JjDWeXX5LBVS051o8fpHS9uVeYPEjJUS2g/HIrl+ZCJSsHb14sEH8VFaL03fdK 0vhCMYVrqc/m2HYNVQFnzsiUOVlRd885amrM9m4PdnnztbjjB0GpYugv0QUKmgMZia3P UuhG8eM1FgBZ+69Zj+JjVL/XgTK98TJOd02o20dh/FTJkJX62B3wOBMOBP8FwvOampiX 30O8NKlwSXvDfLpmzbBs3neV5caSOZV3C1IFpDJPSZ1SRDOI4ewHVGR+ehu3K1EVhUkc MpCQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ONzs0fVmve/S5ghcbzdDMuQ75IIJkGqSlNozVFCWB0E=; b=eI7Nne8o1AgvUX2VWwQCILEchymZahu9eJd9lJ3rYAx5VOai4rTmkoS8RVRcujFm1o CvPjhHC/867IX7zl53qPFr8sNwTPbwiMk0GbL/ZD/oXRwx6LDuhG3yVJf2sMf1yayOYA RKlgLHh1cPvU7dgLeMzRIRnSvd+IVKyCndyFjTsNLssHYzsX+9LBj23JpJ48QOhZ2tm7 ZyPf883DQzPPr36kBl/rIY7oadJCyzY60iYVkBf3zTWcrISkr+kVRVKBsh+yIPgK1wNF xp+4QuHsuN8FLXF+bRT42Lolu855hM5LkiJD9WmRUpKZlrod/O+DBVQ3VGqqW19bsOiN qPyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ptPSu9/r"; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k38-20020a634b66000000b00439befcd2b7si17946500pgl.725.2022.10.19.03.17.14; Wed, 19 Oct 2022 03:17:26 -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=@linuxfoundation.org header.s=korg header.b="ptPSu9/r"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233986AbiJSJga (ORCPT + 99 others); Wed, 19 Oct 2022 05:36:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233932AbiJSJ35 (ORCPT ); Wed, 19 Oct 2022 05:29:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25317ED9A1; Wed, 19 Oct 2022 02:13:33 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 22970617ED; Wed, 19 Oct 2022 09:13:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3309AC433C1; Wed, 19 Oct 2022 09:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170806; bh=YJbnZ0RTeY+t7PcY4eYKEecQAqN2QYIiIc5b5AmosT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ptPSu9/rqSLrVFkZK/gest72IAu/J4FJMkiWleL3Kblw6U6DLUl5Pe2eJNCo/7Ahm paJow7SuQtX1CeBPBqboSe50qRCN6SQOIKeo45gbfsNSpQR6ABxQs7hx5QEZq9beje 8/lpXGsJqqTtbz5mEvcn9hIURMBf0C72fFaU83Pg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hangyu Hua , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 6.0 794/862] media: platform: fix some double free in meson-ge2d and mtk-jpeg and s5p-mfc Date: Wed, 19 Oct 2022 10:34:41 +0200 Message-Id: <20221019083324.999230687@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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