mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
drivers: Destroy mutex and sem in the error path
also correct the order to ensure the memory free is last step Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Masayuki Ishikawa
parent
dee38ce3e8
commit
dca5a3483f
@@ -1481,6 +1481,7 @@ static int usbclass_classobject(int minor,
|
||||
return OK;
|
||||
|
||||
exit_free_driver:
|
||||
nxmutex_destroy(&alloc->dev.lock);
|
||||
kmm_free(alloc);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user