From: Jing Xiangfeng Date: Mon, 12 Oct 2020 02:56:43 +0000 (+0800) Subject: HSI: omap_ssi: Don't jump to free ID in ssi_add_controller() X-Git-Tag: v4.14.213~127 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e28b2e0660029ab7d0f4f052d8f4cfeb4960cdd2;p=thirdparty%2Fkernel%2Fstable.git HSI: omap_ssi: Don't jump to free ID in ssi_add_controller() [ Upstream commit 41fff6e19bc8d6d8bca79ea388427c426e72e097 ] 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 Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c index 88e48b3469164..3554443a609cb 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -389,7 +389,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;