From 9267c85769e62c10961451fd28e88de996fdf401 Mon Sep 17 00:00:00 2001 From: Alexander Aring Date: Thu, 17 Nov 2022 17:11:41 -0500 Subject: [PATCH] fs: dlm: drop lkb ref in bug case This patch will drop the lkb reference in an very unlikely case which should in practice not happened. However if it happens we cleanup the reference just in case. Signed-off-by: Alexander Aring Signed-off-by: David Teigland --- fs/dlm/ast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/dlm/ast.c b/fs/dlm/ast.c index 078bbbd4..982d093 100644 --- a/fs/dlm/ast.c +++ b/fs/dlm/ast.c @@ -186,7 +186,7 @@ void dlm_callback_work(struct work_struct *work) spin_unlock(&lkb->lkb_cb_lock); if (WARN_ON(rv == DLM_DEQUEUE_CALLBACK_EMPTY)) - return; + goto out; for (;;) { castfn = lkb->lkb_astfn; @@ -217,6 +217,7 @@ void dlm_callback_work(struct work_struct *work) spin_unlock(&lkb->lkb_cb_lock); } +out: /* undo kref_get from dlm_add_callback, may cause lkb to be freed */ dlm_put_lkb(lkb); } -- 2.7.4