From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81CE22AE8D for ; Sat, 27 Jun 2026 06:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782542334; cv=none; b=QKkPVdBVkMoeNbirMNKgeYES9wZnylAKWfmN51nDbGW5lyC4qMp9RvJaCmySF83qCdwVXxtCdDBqqbfRvfcIRmy09kQH8KYx1qPTuvr7BFsjOSNPHkPLqg3tu8KXta5C5dKkddSoEYhjXmbEGpFIRS3ibMiuwCtD8zS+kDqIimk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782542334; c=relaxed/simple; bh=ParnwBExfgSuCvGNbbNh3YhRq5Zw4wfCqZvmdKMow3E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=K2s2cQDyewT3i6MpsFZCwGIrwa+u7T871yk1wlDJCru/gPV/i5xVrd193ISNJeJsRUNk8vbdrDH69fK5UGh0Uek3JDogv6fZ6ZIDHKslHuT+v6Z1sm1J0PgSUM9qhXRVsizB9Igsq4btaqElHhpLJdU+QU1aTLUtCjD0IsRVdcs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cYUNIGts; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cYUNIGts" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-49222fb062bso18099365e9.1 for ; Fri, 26 Jun 2026 23:38:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782542332; x=1783147132; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ParnwBExfgSuCvGNbbNh3YhRq5Zw4wfCqZvmdKMow3E=; b=cYUNIGtsu5USkdNL1kWDKED6UGY3amvoVIWndLefcSqLPshsB81MT0e0ZrsIDrz/dU KJ05e5/u9VhQpC2Qmoa3vNlt93sAFHTncf0HL3i7pDuYZra+1tPyJuxG5uleoyxaMGO6 zEjC2gKZTzShWeNkdXpfzk0l3NpEJr4vPXkYmJK9ext0Te707EAzAuUFPXLblYvChTMb s1gWsDa56z9cxveMF3ue2cWC37z56xzQyqNQ/F8Epo6i2PsEqwos0/f80Ka9z2KN5fNE ZFsBJ4UaBZZMCQMo8kvcCVub0+MdwpuZMljji14J67jIA1LtRSDOQzdANCzvB/s/lw1b 9X1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782542332; x=1783147132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ParnwBExfgSuCvGNbbNh3YhRq5Zw4wfCqZvmdKMow3E=; b=qyIC0TYVFqcvDKzuxuk5OnLo7aajzmyA/9IgQsMKNjLwWQBByEp4AxxSkslM7hzse6 aTCgf2FD864hcQ8+eS52ji0Lsi/zVyYVFHptQYgZvLaYg+G4udnUQzS/ZZJoR962HzvB eBRDjdBNfRrzfZwq9CNttpcoVhyC5SWt4LQQ5gqQuOfltKVW47K0kK2TO24BWhxM0Q1P IDmL046cFJGDL7HbRmDxrstvV4N3E1roUFB/DCP5jlxS5Ar065b9gfm3DwZuZXOftsZF 3iM/O4IJ3acfKzKgNRYMlMLy+AJB9X290dBOPjVwiGFRXy3JNpqiDl72yWf2mqOfkJj9 8XYg== X-Forwarded-Encrypted: i=1; AFNElJ/zH8dmxD5LrZlH/HKoCiYdF+KfAFFsa0XM1mo3ll/Fs3C4g5NzAw4dK5tslgUs8jP2qoqnkWjolu3R7RI=@vger.kernel.org X-Gm-Message-State: AOJu0YwfkGEGwBkjjI8ZvxYXpinRafMuUYdaKQeo9vjFPPlURnXYr9N2 sxV6FJ3L6fbXgB8cUxE4vtED4VELdSpo5XoQMjEfS1WwD+7se5IYgYlV X-Gm-Gg: AfdE7ckxj/2IvWOpZAUQyOqpvUG/q0B7JabKhnddA4j4PUJ/1GKUNku6OSL3dmpL846 h/1W3rx9KgX9yJLQMj90kgD1BIwHBp2Jn6aIR//thDPOw7ZD177Umhi5ZYq407bB3gY3J8d/SY+ 39z8PCQEL2XgQUJjtDnGbR0zNI/4LOWFLTREy7d4pZn06nQhNY3nnXDGqJ8CI9aq0sep5zoeoX4 EkNIwzDiEmf8WO0W7NbtCGPFQbblT8Fgr2bt8/9qlYZdygxRgjfXDvBZDD1tckCq6nIRdnOti46 cZ3rQN8zQBJ8N1+xeEYDOLvLGDvhCQID+33CwCNwdb+r2G3wzb3vowCH/3FLKLMb+/P5Jn6GIeC b10WgtiD8CEyDYO4+52kiwM78HeNsvLekg7yPa1MK+JsqW1LI8q8WT5IL584MBGbGNa7fUNkwv1 SyBPtqOChospvC7Pv2wXgKna90KS0rOYoOVTEgfbeR0rX4O1m6TruNgvEPc5WKfgHiKQ== X-Received: by 2002:a05:600d:8499:10b0:490:e196:6574 with SMTP id 5b1f17b1804b1-49266864b4cmr108469495e9.13.1782542331948; Fri, 26 Jun 2026 23:38:51 -0700 (PDT) Received: from jernej-laptop.localnet ([188.159.248.16]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4927038578bsm67964385e9.4.2026.06.26.23.38.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2026 23:38:50 -0700 (PDT) From: Jernej =?UTF-8?B?xaBrcmFiZWM=?= To: mripard@kernel.org, Dawei Feng Cc: paulk@sys-base.io, mchehab@kernel.org, gregkh@linuxfoundation.org, wens@kernel.org, samuel@sholland.org, hverkuil@kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, jianhao.xu@seu.edu.cn, zilin@seu.edu.cn, Dawei Feng , stable@vger.kernel.org Subject: Re: [PATCH] media: cedrus: fix memory leak in cedrus_init_ctrls() Date: Sat, 27 Jun 2026 08:38:49 +0200 Message-ID: <3HodGaD_QKy_OLZfdyJ49A@gmail.com> In-Reply-To: <20260624085920.578446-1-dawei.feng@seu.edu.cn> References: <20260624085920.578446-1-dawei.feng@seu.edu.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Dne sreda, 24. junij 2026 ob 10:59:20 Srednjeevropski poletni =C4=8Das je D= awei Feng napisal(a): > In cedrus_init_ctrls(), the V4L2 control handler is initialized before > allocating memory for ctx->ctrls. If this allocation fails, the function > returns -ENOMEM without freeing the previously allocated handler > resources, leading to a memory leak. >=20 > Fix this by calling v4l2_ctrl_handler_free() on the ctx->ctrls allocation > failure path. >=20 > The bug was first flagged by an experimental analysis tool we are > developing for kernel memory-management bugs while analyzing > v6.13-rc1. The tool is still under development and is not yet publicly > available. Manual inspection confirms that the bug is still > present in v7.1.1. >=20 > An x86_64 allyesconfig build showed no new warnings. As we do not have an > Allwinner SoC or board with a Cedrus VPU available to test with, no > runtime testing was able to be performed. >=20 > Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver") > Cc: stable@vger.kernel.org > Signed-off-by: Dawei Feng Acked-by: Jernej Skrabec Best regards, Jernej