aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Aring <aahringo@redhat.com>2024-04-23 08:52:31 -0400
committerDavid Teigland <teigland@redhat.com>2024-04-23 16:08:55 -0500
commit7b72ab2c6a468305449db8f204bf1e406fd3e147 (patch)
tree2c29dd1f61a40601cc5f020ec309b54f9ac40cfa
parent7b012732d005fba22912dda038dd253e3b9a1bfc (diff)
downloadlinux-dlm-next.tar.gz
dlm: return -ENOMEM if ls_recover_buf failsdlm-6.10next
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"). Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202404200536.jGi6052v-lkp@intel.com/ Fixes: 6c648035cbe7 ("dlm: switch to use rhashtable for rsbs") Signed-off-by: Alexander Aring <aahringo@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
-rw-r--r--fs/dlm/lockspace.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index ed23787271b11a..475ab4370ddae3 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -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;