From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A041434252D; Sat, 12 Sep 2026 07:38:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789198683; cv=none; b=VVyWw9JSOLzC4fzw0jL0lTo7dJExHKYRXGjlQmSyvAPF9R+DhFlmuFdSK0uP2cDqhxWy1jrNdeeB2ivxMYf5cXXXJkHuXCbC59/jZy+VLv/bmz95ECLQHSo7INGapz5sszCh4k186LEsQEWULNDdwYw8BIqpfvjwR9WEa39swM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789198683; c=relaxed/simple; bh=jA4KA/kbuGhpwaiw4YY0Dm6DkIPUQ+gQOlvXCkA+HrE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZFOMvjUywVgw0bNkbVpAbRluJdvwMYZiq99uNTY21WNl3C+8bevm4l1LNM+XhWj+3uK1r2FBPz/gWkWpWsvO9GDZKvuHVeRDirYyWOR0nbPCR1nm7IckFKnxVaBUSCcHIs3yHTSeOMe8aK0W3VBchhbaRvvIf9CYcR3npBn6MP4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Eqj0sh18; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Eqj0sh18" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A61AB1F000FF; Sat, 12 Sep 2026 07:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789198682; bh=7ryZfXq5OvexD2K3+cjCtyVpVHzazk2hOVw4RMeVc5w=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Eqj0sh18sWGOsSNNLo+4WjXQD0y1RHSkjY5GX0DqB9DGONKT/4Hsl7H5tDzBqf554 30kuzJ4GAkHjTUSlnJQLqlLkxecx1x4drR+4T+pF0/ArofOZRgEAYSeKyw1I5mZ/mG ufwle9Iu45Cy50BUKOyBdOyFrgZb7d88ok4Do1ac= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Eugen Hristev , Laurent Pinchart , Sakari Ailus , Sasha Levin Subject: [PATCH 7.2 0431/1815] media: bcm2835-unicam: Fix asc leaked in error/remove path Date: Sat, 12 Sep 2026 08:36:21 +0200 Message-ID: <20260912065659.013244945@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065648.999753832@linuxfoundation.org> References: <20260912065648.999753832@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Eugen Hristev [ Upstream commit 253c9659e25131b0169f718e7d094ac1aa0d9279 ] v4l2_async_nf_add_fwnode_remote() allocates the asc, which is freed when v4l2_async_nf_cleanup() is called. Call v4l2_async_nf_cleanup() properly in the driver paths. Discovered with kmemleak after rmmod: unreferenced object 0xffff000084526b80 (size 64): comm "modprobe", pid 185, jiffies 4295013512 hex dump (first 32 bytes): 01 00 00 00 00 00 00 00 e8 0d ff bf 00 00 ff ff ................ 40 83 bc 84 00 00 ff ff 60 83 bc 84 00 00 ff ff @.......`....... backtrace (crc ac584083): [<00000000ffb081a7>] kmemleak_alloc+0x38/0x44 [<00000000d2fd9301>] __kmalloc+0x1b0/0x250 [<000000004dd5354d>] __v4l2_async_nf_add_fwnode+0x28/0x9c [<0000000067587657>] __v4l2_async_nf_add_fwnode_remote+0x3c/0x64 Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface") Signed-off-by: Eugen Hristev Reviewed-by: Laurent Pinchart Signed-off-by: Sakari Ailus Signed-off-by: Sasha Levin --- drivers/media/platform/broadcom/bcm2835-unicam.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c index cc7627e9a51a8..14bb916dd7b1b 100644 --- a/drivers/media/platform/broadcom/bcm2835-unicam.c +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c @@ -2614,6 +2614,7 @@ static int unicam_async_nf_init(struct unicam_device *unicam) return 0; error: + v4l2_async_nf_cleanup(&unicam->notifier); fwnode_handle_put(ep_handle); return ret; } @@ -2746,6 +2747,7 @@ static void unicam_remove(struct platform_device *pdev) v4l2_device_unregister(&unicam->v4l2_dev); media_device_unregister(&unicam->mdev); v4l2_async_nf_unregister(&unicam->notifier); + v4l2_async_nf_cleanup(&unicam->notifier); unicam_subdev_cleanup(unicam); -- 2.53.0