Skip to contentSkip to conversation

dlm: return -ENOMEM if ls_recover_buf fails

PATCH New Alexander Aring 1 participant 1 message Apr 23, 2024 Distributed lock manager (DLM)

lore
Share & tools
lore

Alexander Aring

author maintainer
#0 lore raw

PATCH 1/1 dlm: return -ENOMEM if ls_recover_buf fails

This patch fixes to return -ENOMEM in case of an allocation failure that was forgotten to change in commit 6c648035cbe7 ("dlm: switch to use rhashtable for rsbs").

---
 fs/dlm/lockspace.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/dlm/lockspace.c +3 -1
index ed23787271b1..475ab4370dda 100644
@@ -482,8 +482,10 @@ static int new_lockspace(const char *name, const char *cluster,
 	 * might send less.
 	 */
 	ls->ls_recover_buf = kmalloc(DLM_MAX_SOCKET_BUFSIZE, GFP_NOFS);
-	if (!ls->ls_recover_buf)
+	if (!ls->ls_recover_buf) {
+		error = -ENOMEM;
 		goto out_lkbidr;
+	}
 
 	ls->ls_slot = 0;
 	ls->ls_num_slots = 0;
Signature · 1 line
2.43.0