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:
Xiang Xiao
2022-10-17 00:50:59 +08:00
committed by Masayuki Ishikawa
parent dee38ce3e8
commit dca5a3483f
45 changed files with 110 additions and 46 deletions
+1
View File
@@ -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;
}