6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ziyan Xu [ Upstream commit 89bb430f621124af39bb31763c4a8b504c9651e2 ] When ksmbd_conn_releasing(opinfo->conn) returns true,the refcount was not decremented properly, causing a refcount leak that prevents the count from reaching zero and the memory from being released. Cc: stable@vger.kernel.org Signed-off-by: Ziyan Xu Signed-off-by: Namjae Jeon Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/smb/server/oplock.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/smb/server/oplock.c b/fs/smb/server/oplock.c index 58f351be5d905..a81c56b3fe965 100644 --- a/fs/smb/server/oplock.c +++ b/fs/smb/server/oplock.c @@ -1142,6 +1142,7 @@ void smb_send_parent_lease_break_noti(struct ksmbd_file *fp, atomic_inc(&opinfo->conn->r_count); if (ksmbd_conn_releasing(opinfo->conn)) { atomic_dec(&opinfo->conn->r_count); + opinfo_put(opinfo); continue; } @@ -1184,6 +1185,7 @@ void smb_lazy_parent_lease_break_close(struct ksmbd_file *fp) atomic_inc(&opinfo->conn->r_count); if (ksmbd_conn_releasing(opinfo->conn)) { atomic_dec(&opinfo->conn->r_count); + opinfo_put(opinfo); continue; } read_unlock(&p_ci->m_lock); @@ -1390,6 +1392,7 @@ void smb_break_all_levII_oplock(struct ksmbd_work *work, struct ksmbd_file *fp, atomic_inc(&brk_op->conn->r_count); if (ksmbd_conn_releasing(brk_op->conn)) { atomic_dec(&brk_op->conn->r_count); + opinfo_put(brk_op); continue; } -- 2.53.0