Call mutex_unlock(&isst_tpmi_dev_lock) before returning on this error path. Fixes: d805456c712f ("platform/x86: ISST: Enumerate TPMI SST and create framework") Signed-off-by: Dan Carpenter <error27@xxxxxxxxx> --- drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c index cdb56a18ea17..664d2ee60385 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c @@ -1399,8 +1399,10 @@ int tpmi_sst_init(void) isst_common.sst_inst = kcalloc(topology_max_packages(), sizeof(*isst_common.sst_inst), GFP_KERNEL); - if (!isst_common.sst_inst) - return -ENOMEM; + if (!isst_common.sst_inst) { + ret = -ENOMEM; + goto init_done; + } memset(&cb, 0, sizeof(cb)); cb.cmd_size = sizeof(struct isst_if_io_reg); -- 2.39.1