From nobody Sat Feb 7 17:55:28 2026 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) (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 DD6A221FF35 for ; Wed, 7 Jan 2026 01:52:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767750740; cv=none; b=qN9tMDybUReAXZ7VvK8VLVg2QwrGqj1nQ3X4mgz7WxCub8ZBsWSyTY/UCBgwMg84G1K6qIoLMJHvd/8E/zQX4EwzWsrrFObn4UIJ8KA8NmED2Wu765rr/agB/OyxRUa/tXJM9sUtyGkFoziGFht/8Cx8ppQ/JYN+p+PGgnhjPAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767750740; c=relaxed/simple; bh=WNWjRZbC+yawsGyhGxzupZ2JlNneUImEGt3I22UCMVc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=G0EYVk0pMY5ybz+5MPF4RWWl+25pjXciIXD0ZF5ZP3FDaK7pG0XApfWieMFRgVBMnps+zAp9nlYBEI9h84Z+Msmr6MeFjqagknmqRcRO9BthqdHZrlqtbiJp8IhQUrZitbDIq5ONCYsFLs5QFbR1wqDDxgbEqp0VASMmB25uH7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=C9uM6JFV; arc=none smtp.client-ip=95.215.58.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="C9uM6JFV" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1767750735; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Iflu0FETmF+N+3Ihbe1LNGC98WYCJactyqJICsq2wtg=; b=C9uM6JFV1F9R1ydLvSQrN4a8je2IIMs6dQFllgXRJSyPMyY4VnZ79uECmmJlwHUa2IPSF0 iujmqEWoJ/YLM9Ff9a0h60NuH5bObxiRCwbont8ZG1crKlJajiGU/1BggEShliVLxrANLv cXRH0Cm3aaKrOy60Z/Qe4AVis4/4j8g= From: sunliming@linux.dev To: rostedt@goodmis.org, mhiramat@kernel.org Cc: mark.rutland@arm.com, mathieu.desnoyers@efficios.com, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, sunliming , kernel test robot , Dan Carpenter Subject: [PATCH] fgraph: Make sure fregs is non-null when accessing Date: Wed, 7 Jan 2026 09:51:25 +0800 Message-Id: <20260107015125.27659-1-sunliming@linux.dev> 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 X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: sunliming Fix below smatch warnings: kernel/trace/fgraph.c:834 __ftrace_return_to_handler() error: we previously assumed 'fregs' could be null (see line 830) Reported-by: kernel test robot Reported-by: Dan Carpenter Closes: https://lore.kernel.org/r/202512131657.JQUt5fXQ-lkp@intel.com/ Signed-off-by: sunliming --- kernel/trace/fgraph.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c index cc48d16be43e..0f50a55032c5 100644 --- a/kernel/trace/fgraph.c +++ b/kernel/trace/fgraph.c @@ -837,7 +837,8 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, u= nsigned long frame_pointe goto out; =20 #ifdef CONFIG_FUNCTION_GRAPH_RETVAL - trace.retval =3D ftrace_regs_get_return_value(fregs); + if (fregs) + trace.retval =3D ftrace_regs_get_return_value(fregs); #endif =20 bitmap =3D get_bitmap_bits(current, offset); --=20 2.25.1