diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 171b2713d2e5..1dba7e29b9c3 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -112,6 +112,8 @@ static void gfs2_qd_dealloc(struct rcu_head *rcu) struct gfs2_sbd *sdp = qd->qd_sbd; kmem_cache_free(gfs2_quotad_cachep, qd); + if (IS_ERR_OR_NULL(sdp)) + return; if (atomic_dec_and_test(&sdp->sd_quota_count)) wake_up(&sdp->sd_kill_wait); }