xfs: fix null pointer dereference in tracepoint

If dfp is not NULL we exit early here, when dfp is NULL it's allocated
in xfs_defer_alloc() but not assigned. The tracepoint tries to
dereference members of dfp struct.

Signed-off-by: Andrey Albershteyn <aalbersh@kernel.org>
Cc: stable@vger.kernel.org # v6.8
Fixes: 3f3cec0310 ("xfs: force small EFIs for reaping btree extents")
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
Andrey Albershteyn
2026-07-09 17:24:07 +02:00
committed by Carlos Maiolino
parent f88caa121e
commit 9202ee546b

View File

@@ -878,7 +878,7 @@ xfs_defer_add_barrier(
if (dfp)
return;
xfs_defer_alloc(&tp->t_dfops, &xfs_barrier_defer_type);
dfp = xfs_defer_alloc(&tp->t_dfops, &xfs_barrier_defer_type);
trace_xfs_defer_add_item(tp->t_mountp, dfp, NULL);
}