Skip to content

Commit ed46bf0

Browse files
pcercueiQuzarDC
authored andcommitted
nmmgr: Check return code of mutex_lock_irqsafe()
The return value of mutex_lock_irqsafe() should always be checked. If the locking failed, we will get an imbalance when we get to the mutex_unlock(). Signed-off-by: Paul Cercueil <paul@crapouillou.net>
1 parent eca2790 commit ed46bf0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/exports/nmmgr.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ int nmmgr_handler_remove(nmmgr_handler_t *hnd) {
8282
nmmgr_handler_t *c, *tmp;
8383
int rv = -1;
8484

85-
mutex_lock_irqsafe(&mutex);
85+
if(mutex_lock_irqsafe(&mutex) < 0)
86+
return -1;
8687

8788
/* Verify that it's actually in there */
8889
LIST_FOREACH_SAFE(c, &nmmgr_handlers, list_ent, tmp) {

0 commit comments

Comments
 (0)