From patchwork Sat Oct 22 07:28:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7681 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1108859wrr; Sat, 22 Oct 2022 01:46:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ex6owJVRQaW9KbOyOtcOUBoKh/p6y7w9dkQ67R56bkMkMtlToq5zTNClfyAfSNplhwMTV X-Received: by 2002:a17:906:36d1:b0:76c:a723:9445 with SMTP id b17-20020a17090636d100b0076ca7239445mr18249533ejc.548.1666428378835; Sat, 22 Oct 2022 01:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428378; cv=none; d=google.com; s=arc-20160816; b=c1EQsjqOi1lEB4mar2qTftXtObGkqkFpL9evpYhwInayU0GOrGXxTcO8aooEm5vNAQ AxT5Uxa78loKgwtMWeSID6pDx63F5QJuJfTwO6/B2jIVLMq7wyckpHLmXIexvV4nfKO+ Rlq2UD0wDmjQTiVDsbEVXBBbp5nnDfGRTZZS/D6qBJihLi5DONZR59Upk0e6uPpMrjIp 7PYNPd1x0fbXxddiHV7yb1rR38qxEMQlednSkZpWo+cwYl3aeyg3XisRAEg+JP30vE43 o6YjHCzYiJPDftOUjIvdPcUmH+0ZrOwqkIYdRltUwQsBLxblw7UmyYLj6eg2+CoEo2+o e3XQ== 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=G4EW3BoP8UR9xOHn7agT63lsNF6Gd1odFaXIjcFSj6g=; b=G8QOwjemaw5BkzzWAK7/wHZXHRnPsLpE7F72yeYFQkMsal1VB9Kmm+nfPcNncQut1L V3Vkc34yLDIMXANL7IM2tHSPQDMWUtM57A7a4ydI5kq5bBFQmfXbPvirIxqN3g4kdyxJ LP0tg8UD3BKencvUiAXOci/OvRQ/VLW+mhmvRQjceR7IFNB0S2UHs7hN99fjhSRG4doc 2gpv3JEdJGqSYatRUq8WeHthBov4Bhf0PN3BfKurr6TgoqPxIKWEBorY/jKbryv8KxTT Pj0wxvFydQMyRSJerHKcdcU8yWKyWoPkMLDNZIEFEOOSh6Va7o5J/7qlLn0iXd+32zso n/RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1OT8JYlj; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id by26-20020a0564021b1a00b004533149e228si19618330edb.618.2022.10.22.01.45.54; Sat, 22 Oct 2022 01:46: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=@linuxfoundation.org header.s=korg header.b=1OT8JYlj; 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 S234882AbiJVIn5 (ORCPT + 99 others); Sat, 22 Oct 2022 04:43:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234381AbiJVIm4 (ORCPT ); Sat, 22 Oct 2022 04:42:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 943CB2E7B80; Sat, 22 Oct 2022 01:07:04 -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 A072B60B9B; Sat, 22 Oct 2022 08:06:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91E67C433C1; Sat, 22 Oct 2022 08:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666426018; bh=Hn/ow9Xin3Od8mQZtZIgLBDPeR+Aq7EySKsOMGbYcTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1OT8JYlj+i+zbvYs5YSKA1QvYHVbQxPDiCShshWRcjNckvvfMKDWP5+p6CegPs6uQ K9LPGMeR1bdQsa2ScpkKS9ue+bDOEfSLgm7iN2s+Ifo8+z8vo3Igi6O7xTvPhBEpsS w1BHzdI0+6pYfQ4wqLjDG5CXVnZngJ9LGA/Mipd0= 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 5.19 652/717] media: platform: fix some double free in meson-ge2d and mtk-jpeg and s5p-mfc Date: Sat, 22 Oct 2022 09:28:51 +0200 Message-Id: <20221022072527.269070264@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376803645638586?= X-GMAIL-MSGID: =?utf-8?q?1747376803645638586?= 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 bc5b0a0168ec..6aa73f1cde18 100644 --- a/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c @@ -1411,7 +1411,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);