Skip to content

Commit 7b72ab2

Browse files
Alexander Aringteigland
authored andcommitted
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 6c64803 ("dlm: switch to use rhashtable for rsbs"). Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> Closes: https://lore.kernel.org/r/[email protected]/ Fixes: 6c64803 ("dlm: switch to use rhashtable for rsbs") Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David Teigland <[email protected]>
1 parent 7b01273 commit 7b72ab2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/dlm/lockspace.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,10 @@ static int new_lockspace(const char *name, const char *cluster,
482482
* might send less.
483483
*/
484484
ls->ls_recover_buf = kmalloc(DLM_MAX_SOCKET_BUFSIZE, GFP_NOFS);
485-
if (!ls->ls_recover_buf)
485+
if (!ls->ls_recover_buf) {
486+
error = -ENOMEM;
486487
goto out_lkbidr;
488+
}
487489

488490
ls->ls_slot = 0;
489491
ls->ls_num_slots = 0;

0 commit comments

Comments
 (0)