Commit 7b72ab2c authored by Alexander Aring's avatar Alexander Aring Committed by David Teigland
Browse files

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 6c648035 ("dlm: switch to use
rhashtable for rsbs").

Reported-by: default avatarkernel test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202404200536.jGi6052v-lkp@intel.com/


Fixes: 6c648035 ("dlm: switch to use rhashtable for rsbs")
Signed-off-by: default avatarAlexander Aring <aahringo@redhat.com>
Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
parent 7b012732
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;