From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 754873F58C4 for ; Mon, 27 Jul 2026 11:22:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785151371; cv=none; b=bAcp7b/Qt+KqCEKNfSKOPrqco3jex1mXxkJ8LMaj9Y+iPJXgmM72udteHoHfp1BrpUNqOiYyfA/vxiPogMcYRXr+bffRlmBg8pLDLk+I04Oop3ckGYGDC29JVKhDet65rM3Ock+6p0x5qUg0PhbSazcSvd0FEGdov4AI9KqkCwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785151371; c=relaxed/simple; bh=GvGPNpCEnQDfHxHOcxa+Ci3ycUkDkZuGgKa+12rrbsA=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=VaP40UbV2mKuf1n2jAIQ8/tNeey9Y0JYz/dCHTQJ/AThVoRtkIzWgfU+ckxnuGM5Jb3GRnZxQqJ7lZAPB7yPdA1GaQvCNqXQXY+ppq7JxZD0uvvGnT/YoDd2X1mdRKoakXJ7lbInCaqyxTjpeQiGuGNpmiy24ceNyMDLIznfHq4= 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=eC5g6P14; arc=none smtp.client-ip=209.85.214.171 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="eC5g6P14" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2cfbbdfa60bso22867355ad.3 for ; Mon, 27 Jul 2026 04:22:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785151370; x=1785756170; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=k5E1s8oCcP+GEyqdmRlB9Q75yjWLw8arRgBTU8DpxFM=; b=eC5g6P14I9t053eUr/GN5Lt+Nxbeo/u0iI+sdxSewr+leP2TxyjPYEIrvWZq91G8c8 Sml6qnrP18jamPW00yOd/YbU3jOpg8b2NTrCOqpo3FN0F0PVeEGjVip0TL0MPPAY6mBY cFr7dfi7YI4NFynXvXafXt0Hzm3AcQPU67Mgu+WXDKRF6LVswJm4YKiw8HHUg4o3PBgN XbY4/jKcZDbmZOzTs7q8LbMUbKlQvV+66FWq2XL3k1Jw0dY2MML/NQ/gTcL79Ohk4MqK G74+8FR+kM6DVvMukNNcfRoEg6gM8CMe4hKp11NIA2jW9zYQNuZTnJ1pWEdNuCc+l1tn 8XAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785151370; x=1785756170; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=k5E1s8oCcP+GEyqdmRlB9Q75yjWLw8arRgBTU8DpxFM=; b=a/uxj6j2y0wj12fDQ7Mnf8v/XIqhHvR/CvxJMWLQev4qcjW0q6WsEbwT+h5OkG7peG AtpvwLvqxKBg8D5l38AhR62r+hf10Px8zX5mSoJ1e9TDux9DgVR/YAq0mCW1IR5FVW7d 0tv8qIqHjBxn6+2jeZos5Fk+SGA3TrVYchbJAvQPLLRvlPUlA6xwcF3j+Bq1Ax2wnTWv 9hp6hojF5qlJnQfkIxs4zWN5/UujX2mHjjeI/PkzTWBXzsprweQLjpyb3Z+HrySgzYol Uk9yBEX+vkIHUsAQHddrXkNigiQL5cWarRMBUdju9yOzc/hjGigHZ+zHO97lsz5WzKkK CzZA== X-Forwarded-Encrypted: i=1; AHgh+RqP8DEmnWmFoZ4cmYZLEJd2UpLKxJE2EST0UHjhZ7ND/+5oazP9sU9eInQ/RmRaaxb+TpFwgNr4Teze4ck=@vger.kernel.org X-Gm-Message-State: AOJu0YwZumFX10zT5uKM7uHpPsq063Gd/prwPw6797UZbvuqZpKnXpAn jv1Dcpxy5lbp2jRrnpbWfTZ+5EaG6VK8pI4tP7gpk9z4yqcQr+CDOI+2+HMt+XUtSo8= X-Gm-Gg: AR+sD109Y4SJwXact4+osNK3N2JPzgIigUVdmt2JK994rnlRCgdkGrXqLOZmni3BeDZ Ct1jYqsA0EWo0U89A+mvbzUzcDxsLr1ztWzG944uZIKzmcVWRXpC+1FN7iLm+lGlQC875YXONyV ZYpeCRqwxB55XTYDp6VA6p+Gdpt7OR4iq5C2Hco0K1V6iKFvYLZKRguEr5YrgCz54QwEPKlqj47 qxjOCEDNh7wJMBJUIIMGiV+4hiZM058k4bSxJeKe6PHMDFUBPHGpPSivPJsW5R4mgSS47mN6Vy2 0+g+3QMRTLioQS4v69THK/RPfetB/ZXjFim/cskolZ4uJHhvxQKLuYnUJVvQI0VwrTHaGLRf2cR bnFmuz51cwnKkJfVl99aRurIHbWfEkKmOUsWdBs1M8hmBGh/jHNgQP3UFWNqf0xqeCh2Zk78GM6 22EAGaNbg3gPStL8/gqHg= X-Received: by 2002:a17:902:ea0e:b0:2cf:ca89:499d with SMTP id d9443c01a7336-2cfde6880fdmr74010545ad.7.1785151369490; Mon, 27 Jul 2026 04:22:49 -0700 (PDT) Received: from SGN-LDSENG.tasernet.com ([2405:4800:5cc3:11a:1ac0:4dff:fe8b:4a69]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cfde5e3e0asm32938925ad.29.2026.07.27.04.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2026 04:22:48 -0700 (PDT) From: Cong Nguyen To: Sakari Ailus , Bingbu Cao , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: Hans Verkuil , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Cong Nguyen Subject: [PATCH] media: staging/ipu7: fix async notifier leak on init error Date: Mon, 27 Jul 2026 18:22:39 +0700 Message-Id: <20260727112239.812159-1-congnt264@gmail.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit isys_notifier_init() initialises a v4l2 async notifier and then, for each CSI-2 port, adds a remote sensor subdev to the notifier's waiting_list via v4l2_async_nf_add_fwnode_remote(), which allocates a sensor_async_sd descriptor and takes a fwnode reference. If parsing or adding a later port fails, the code jumps to the "err_parse" label, which only drops the current endpoint fwnode reference and returns, without calling v4l2_async_nf_cleanup(). Any descriptors already added to the notifier for earlier ports are therefore leaked, and the caller's error path does not clean up the notifier either. Call v4l2_async_nf_cleanup() on the error path, matching the cleanup already performed when v4l2_async_nf_register() fails. This is safe as the notifier is always initialised before the loop is entered. Fixes: a516d36bdc3d ("media: staging/ipu7: add IPU7 input system device driver") Signed-off-by: Cong Nguyen --- drivers/staging/media/ipu7/ipu7-isys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/media/ipu7/ipu7-isys.c b/drivers/staging/media/ipu7/ipu7-isys.c index cb2f49f3e0fa..c626de051898 100644 --- a/drivers/staging/media/ipu7/ipu7-isys.c +++ b/drivers/staging/media/ipu7/ipu7-isys.c @@ -233,6 +233,7 @@ static int isys_notifier_init(struct ipu7_isys *isys) err_parse: fwnode_handle_put(ep); + v4l2_async_nf_cleanup(&isys->notifier); return ret; } -- 2.25.1