Skip to contentSkip to conversation

HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()

PATCH New Jing Xiangfeng 1 participant 1 message Oct 12, 2020 HSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()

In current code, it jumps to ida_simple_remove() when ida_simple_get() failes to allocate an ID. Just return to fix it.

Fixes 0fae198988b8 ("HSI: omap_ssi: built omap_ssi and omap_ssi_port into one module")
---
 drivers/hsi/controllers/omap_ssi_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hsi/controllers/omap_ssi_core.c +1 -1
index fa69b94debd9..7596dc164648 100644
@@ -355,7 +355,7 @@ static int ssi_add_controller(struct hsi_controller *ssi,
 
 	err = ida_simple_get(&platform_omap_ssi_ida, 0, 0, GFP_KERNEL);
 	if (err < 0)
-		goto out_err;
+		return err;
 	ssi->id = err;
 
 	ssi->owner = THIS_MODULE;
Signature · 1 line
2.17.1