From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (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 D3DBB7080E; Mon, 16 Mar 2026 07:33:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773646422; cv=none; b=Kym7B77Dj7vxvbOmZtDdKh0gBfdVtMJVnvnr9dMiq6+adkSlrz4EWaghhUJ+HczEgRg+OVx6H/UnTUUJjxlRetfIwWXTzUhjDL458cHMAFVraI+K+DD6lis/odu0hMROahW8s7CFY0aalX+2wCDiU1iB0HPhbUYl0LCekDvgjdw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773646422; c=relaxed/simple; bh=lMJh/B8s6RKKLsGwHJ9H9BCGQ0cL1TiCz3Zn0+0Z9dg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qgqYdQYDDemWc7vDoCQNlVzWtRsGYnleMXBIdMMXakuroiKVCTug1U/E8T8wHIvw4t/0jH154/WqYJGZvC5mdemARjvNgmdOfxgV8pGpJtLMaggrEmlh0AZEq7KdlIWVq+diScd1wcBQCKtANJ3tJ69qLP8VSZ3jgjMuvl/tuno= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=wEifpidi; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="wEifpidi" Received: from ideasonboard.com (mob-83-225-32-8.net.vodafone.it [83.225.32.8]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 05487B1A; Mon, 16 Mar 2026 08:32:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773646346; bh=lMJh/B8s6RKKLsGwHJ9H9BCGQ0cL1TiCz3Zn0+0Z9dg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wEifpidintO8wKQ01n2nATYJzlgq8Gw2294JWvRrUeLHPC4GjAXD9WX1kUsPmELGN bbNVFUyU0Lnf9JDFsyQiP7y27kmSVyxeLQopX0o8Xk2assds6i9U4ys2OcwcV8L976 ePQLpr/yeAuUqLhbytmh3lTBTQ2jOkLW6pCPzZsg= Date: Mon, 16 Mar 2026 08:33:33 +0100 From: Jacopo Mondi To: Ethan Tidmore Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Hans Verkuil , Laurent Pinchart , Sakari Ailus , Jacopo Mondi , Tomi Valkeinen , Kees Cook , Chen Ni Subject: Re: [PATCH] media: subdev: Fix error pointer dereference Message-ID: References: <20260314030228.1133429-1-ethantidmore06@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Hi Ethan On Fri, Mar 13, 2026 at 10:06:43PM -0500, Ethan Tidmore wrote: > On Fri Mar 13, 2026 at 10:02 PM CDT, Ethan Tidmore wrote: > > The function media_pad_remote_pad_unique() returns an error pointer upon > > failure, not null. > > A patch has already been submitted to fix this issue https://patchwork.linuxtv.org/project/linux-media/patch/20260313063946.3220962-1-nichen@iscas.ac.cn/ > > Add check for error pointer and extract the error code with PTR_ERR(). > > Detected by Smatch: > drivers/media/v4l2-core/v4l2-subdev.c:2588 v4l2_subdev_get_frame_desc_passthrough() warn: > 'remote_source_pad' is an error pointer or valid > > drivers/media/v4l2-core/v4l2-subdev.c:2595 v4l2_subdev_get_frame_desc_passthrough() error: > 'remote_source_pad' dereferencing possible ERR_PTR() > Chen Ni: have you used Smatch as well ? Should you add the above lines to attribute the bug report to it ? Thanks j > > > > Fixes: a564839e630c1 ("media: subdev: Add v4l2_subdev_get_frame_desc_passthrough helper") > > Signed-off-by: Ethan Tidmore > > --- > > Forgot to add the Smatch warnings, if this version is good please add > this to the commit message. > > Thanks, > > ET