Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp1140711rdf; Wed, 22 Nov 2023 06:43:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGVVIFrhDQB+C2v9ri22n4e76TalYK6xTVDw75kON27OdF552P0y0KbkLofez1vbHp9RRA5 X-Received: by 2002:a17:902:f690:b0:1b8:b382:f6c3 with SMTP id l16-20020a170902f69000b001b8b382f6c3mr2932482plg.13.1700664185239; Wed, 22 Nov 2023 06:43:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700664185; cv=none; d=google.com; s=arc-20160816; b=xkPjWArbaSfpBPh9g5YCxGiK3iVDteXBjkpvZH0gSGCtDEq9g/YB1rfJchP5dng27W rLS1mDHMi74Jj+3ulUgs09rwMXxR+Ktvxz3KpnV0D6ZHl7DrGL27BkH57UnCk4sTr8rg /koG4gAxFk5zoFu1RUNFqxtv8FuJJJjIM4WwhucrdUVG8ey7GKfcp1CQSAzkLpTNeb0/ GudvzdoZmIYJTa3X0uAvnSjfcY7fr9wnZ3oCf5JNMvQki7W5tssCNleKMvHvZjqMQkrO 8H+VX39i8uwXde8ubtHFx3IYRxHMlBB8uPqfMTJgfIaZTaRNh4a+gq2GnekNQZpwSk9k 8Zog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=2EL/Xw6nMeUkAeZrfcvOTNtd5gQlTm8xPyn+maHo/kQ=; fh=e2+FywPT74OKeNAVnhPDEB5sc4CoF2aRKIHvw6X2EL4=; b=Hta8GjdiYAzxnm8aK2EnorIOLQHsqAXnrb21NoqawVFWO7bm+rYfUHYJxgX53VgeYP GMtqE9xXgVhxZesuETAUY3ZB166s95mANhKMj/gLC20Kdp9Jh7apSXBKE2Kk656nvXEM /+/bc4JCVfRY3V4RlFEwMYkyIfJUANUiEl4k8aeZqzM438QVwg1iL+wJFbzHSIGJSEHi lxZ56mftRBaUmfw/nteDbV+kaU1M+3Wr2AVrUMHNHopdZxLEndX/jvOF1UDGyLgBMdov qnRz1Vw1ptE0uKSYgiRstkxzuII3lw+mq1QUvS9QkODDf6gTtAl5c6x37KC5PIXq2SpZ 4u8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YP9asx6S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m13-20020a170902db0d00b001cf7c10d3f3si870342plx.77.2023.11.22.06.43.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 06:43:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=YP9asx6S; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id EFBCC81A3366; Wed, 22 Nov 2023 06:43:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343836AbjKVOm7 (ORCPT + 99 others); Wed, 22 Nov 2023 09:42:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjKVOmz (ORCPT ); Wed, 22 Nov 2023 09:42:55 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A27497; Wed, 22 Nov 2023 06:42:51 -0800 (PST) Received: from [127.0.1.1] (91-158-149-209.elisa-laajakaista.fi [91.158.149.209]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4232E641; Wed, 22 Nov 2023 15:42:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1700664138; bh=m/zEIfXXTHvQjozZAyjiA6eqZQPUBkii1euXSnYoOvE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=YP9asx6SDnlDNjkOD34Fz3GV/GuZuWTjB9tLPdQb3cvh1GK1PGI3jnm/eoIe+qFGt Diywgb9kB03JB7zlTkKO6R2NPSgJVqBuV1vtxTIN/2B1j8YAfFEoaZcek6ocFAHg8D o7I9SHopGhyZxZ4N8VMmkC9fjLblP1g+CHIv5hJQ= From: Tomi Valkeinen Date: Wed, 22 Nov 2023 16:42:22 +0200 Subject: [PATCH 1/2] media: rkisp1: Fix media device memory leak MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231122-rkisp-fixes-v1-1-1958af371e39@ideasonboard.com> References: <20231122-rkisp-fixes-v1-0-1958af371e39@ideasonboard.com> In-Reply-To: <20231122-rkisp-fixes-v1-0-1958af371e39@ideasonboard.com> To: Dafna Hirschfeld , Laurent Pinchart , Mauro Carvalho Chehab , Heiko Stuebner , Jacob Chen , Yichong Zhong , Shunqian Zheng , Paul Elder , Sakari Ailus Cc: 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, Tomi Valkeinen X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=openpgp-sha256; l=1184; i=tomi.valkeinen@ideasonboard.com; h=from:subject:message-id; bh=m/zEIfXXTHvQjozZAyjiA6eqZQPUBkii1euXSnYoOvE=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBlXhNmoGXYrkOE3AdB7Fp5rvOueSko64nRBHCyK qKps9vLkRSJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCZV4TZgAKCRD6PaqMvJYe 9V4vD/9mS6a40zwMwT1NDJ+tXjKAo93DSsj3Q6ByOm9ye0/hPin7RMgZVFGa4q+ojuJnwwONjDb +TK2xaI3pQwgrd53zTS6cgTB0wcYLzShBoNMiDZpUP2jqM+p7vGfI/fAsGsphM67OoTNRh8VuBU oXYpKWgfgfIpiUujcLk9JbxzvnHQL8jZBV8xw2bjdxHuGovFWRGcegiCmF957Nyip8OJzNrP1tj X/wqq2vsdxdRmRTAF+WhqEAZBoJRlCCsV8k0R3hbemf/NgPoff+0Slnz9Iv8tIC1ffof83vNKu1 U4nsbEEjIiCuOiVTWhE2+kTwcqThZXjWCPXzPJq3xNTugvYDmrCrl0l6cgti8n7XuhwqS7UJzvL BFuslCUgclBqOldOfLOFAMRm7tSlUqjdc3K2E3BZtCndzqO9zbrnCfSV4JqaUGAmfapIlm5ltRh NnIyIjIHo5t1v61964DsmBk+ezYh/uBBsNhvsi5vHJSo2JNqhUJWxw+1tZxqxuQ6QJ6rgXXHp6k lHOi0yBTgq9a4lbBdORqVHGG4WB2maQJq6egxHqmh1KU6N77c+Iw/5nNxqXHn/W/lmXQYV5Wrvf 3BXb86pagpZjhXhsf7Qe7+CZ089UsFY+/dvlLlqtt5wWgZ/wxkhTiNLevHl9FJhIh+eDhsd8Q6L 6VkHW9jMtVkw7AA== X-Developer-Key: i=tomi.valkeinen@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 22 Nov 2023 06:43:04 -0800 (PST) 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); 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); } -- 2.34.1