HSI: omap_ssi: Don't jump to free ID in ssi_add_controller()
authorJing Xiangfeng <jingxiangfeng@huawei.com>
Mon, 12 Oct 2020 02:56:43 +0000 (10:56 +0800)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sat, 28 Nov 2020 23:39:29 +0000 (00:39 +0100)
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")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/hsi/controllers/omap_ssi_core.c

index fa69b94..7596dc1 100644 (file)
@@ -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;