diff --git a/libxfs/xfs_defer.c b/libxfs/xfs_defer.c index 077e99298..5bdc8f5a2 100644 --- a/libxfs/xfs_defer.c +++ b/libxfs/xfs_defer.c @@ -909,12 +909,14 @@ xfs_defer_finish_recovery( struct xfs_defer_pending *dfp, struct list_head *capture_list) { + const struct xfs_defer_op_type *ops = dfp->dfp_ops; int error; - error = dfp->dfp_ops->recover_work(dfp, capture_list); + /* dfp is freed by recover_work and must not be accessed afterwards */ + error = ops->recover_work(dfp, capture_list); if (error) trace_xlog_intent_recovery_failed(mp, error, - dfp->dfp_ops->recover_work); + ops->recover_work); return error; }