Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1186679rdf; Wed, 22 Nov 2023 07:47:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHtcSOQQ+uf1xO2PAt9auOIARiF7WLIb2gBlpBvP0nFnlUvZ20N5rd52q/74lW061AjX5Ht X-Received: by 2002:a17:903:246:b0:1cc:2f05:7edb with SMTP id j6-20020a170903024600b001cc2f057edbmr2723414plh.35.1700668039987; Wed, 22 Nov 2023 07:47:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700668039; cv=none; d=google.com; s=arc-20160816; b=WtTDml7CGqkdh2uzgRUBYzI3nlMBsMXW4FCWOs5sz4expfGF9MPttYe+yA4nQYEC14 MTzbf5OdR5UHoYL5z+DUB+iR0j5JQpe+4f6Lky6C7+lWU4KGH32aT+w2FDdzAmvPimo3 eHZfkvL9pUCcFOTBapNoPD3cqfmrgeieMHnoaw20FwfZFSf8h9jw1mIbNZs4XRNXyAUj iXtY/02nXh+I92eYGtn0GHsOZl4nKOQiUDbo0+teakrrZAKmEe46N6cfphyBNLcu9mY1 tU/E/Ohh7THH+UxDsQUR4yHBwngDJSvL/+wfuWqFUgjP8PaClmh9jsnYHbyiDT/ZVA6f en5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=/8RlA7PL/ltkTdRWAk1bzAF4kiwSxCzJfwhJpddTQ2s=; fh=O6AKoZVERGV5uFwKmcMDa69sdDQ3QPYGj4KN/4FIrVE=; b=LilvAVhBoWYM55uuO2OSD7EJ74nDdX09k2Av4ihQLKmH/ES54jKGNsDRIPhaOM7Y8Z 0Fud9k330Eg+52W5klh/5O11Xv847cZiZnanERp4klfd+iokCZhjFXaH2OS9G2g4PVzR ypW1Hmxab3pY8Ac/VgzY8pPDfrjI0nxnv4K/RyGOUvh1qkwIQEgCzSk4Lko4rmLsX8YS 8HlkgoeoaAcMePnmwSP5dhgQRGfsBdn7zQIUemFm/3CAgPL2oiZMW9tf3XskzATWNZM6 +/wyEh7v9OufzLPJvyoPE6USEbqzehHLp6lSDUHvMsrBxFq6+EJO+Al8IwgNmG5Gbz00 ANVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="WsSYv/Wt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id l13-20020a170903244d00b001cf7c3a22c9si951801pls.276.2023.11.22.07.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 07:47:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="WsSYv/Wt"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 7F63D8074042; Wed, 22 Nov 2023 07:46:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344531AbjKVPor (ORCPT + 99 others); Wed, 22 Nov 2023 10:44:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235279AbjKVPo3 (ORCPT ); Wed, 22 Nov 2023 10:44:29 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA9C44493; Wed, 22 Nov 2023 07:42:27 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5B9FE276; Wed, 22 Nov 2023 16:41:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1700667714; bh=bn0nJ8Ndl9lU9tfsNi9BaoIDkaD6hNR0oaXanoGoHA8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WsSYv/Wt9RtbEjCqnVDlohKNe7Oy5LK1lfPrHMFxE/+WMWbfeIlcOSYqt7lnZ/oXV E6fWt1qJ5io4vjj3tztrcNK9CkNjfZR1dxWs9ToXW2+RqV0L7pd1X19fHiCPwrUz0s lDwOFvs9iOoHS4QLrZOX7Fb3+STspsr4diN26pFM= Date: Wed, 22 Nov 2023 17:42:31 +0200 From: Laurent Pinchart To: Tomi Valkeinen Cc: Dafna Hirschfeld , Mauro Carvalho Chehab , Heiko Stuebner , Jacob Chen , Yichong Zhong , Shunqian Zheng , Paul Elder , Sakari Ailus , Kieran Bingham , Hans Verkuil , Eddie Cai , Allon Huang , Jeffy Chen , linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] media: rkisp1: Fix media device memory leak Message-ID: <20231122154231.GH3909@pendragon.ideasonboard.com> References: <20231122-rkisp-fixes-v1-0-1958af371e39@ideasonboard.com> <20231122-rkisp-fixes-v1-1-1958af371e39@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231122-rkisp-fixes-v1-1-1958af371e39@ideasonboard.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 07:46:19 -0800 (PST) Hi Tomi, Thank you for the patch. On Wed, Nov 22, 2023 at 04:42:22PM +0200, Tomi Valkeinen wrote: > Add missing calls to media_device_cleanup() to fix memory leak. > > Fixes: d65dd85281fb ("media: staging: rkisp1: add Rockchip ISP1 base driver") > Signed-off-by: Tomi Valkeinen > --- > drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > index c41abd2833f1..e10cc2881757 100644 > --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c > @@ -617,6 +617,7 @@ static int rkisp1_probe(struct platform_device *pdev) > media_device_unregister(&rkisp1->media_dev); > err_unreg_v4l2_dev: > v4l2_device_unregister(&rkisp1->v4l2_dev); > + media_device_cleanup(&rkisp1->media_dev); As media_device_cleanup() cleans up for media_device_init(), shouldn't it go to the err_pm_runtime_disable label ? The label may need to be renamed to err_media_cleanup then. Reviewed-by: Laurent Pinchart > err_pm_runtime_disable: > pm_runtime_disable(&pdev->dev); > return ret; > @@ -637,6 +638,8 @@ static void rkisp1_remove(struct platform_device *pdev) > media_device_unregister(&rkisp1->media_dev); > v4l2_device_unregister(&rkisp1->v4l2_dev); > > + media_device_cleanup(&rkisp1->media_dev); > + > pm_runtime_disable(&pdev->dev); > } > -- Regards, Laurent Pinchart