Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3714525pxu; Sun, 11 Oct 2020 21:40:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiVYFR9760dptEy0moPypLEhxWftSo7TJFuw9R981jPTl9L+BCy8lC42Pva2m4hu/B1Blo X-Received: by 2002:aa7:dcc7:: with SMTP id w7mr12367503edu.80.1602477639169; Sun, 11 Oct 2020 21:40:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602477639; cv=none; d=google.com; s=arc-20160816; b=ZmJ8P51XDmWxz3DwFrTLCh19N5mtEABTl3gXfWhSHCL9kYNV/UPqSsMuAI3ZQFrXGs vCmImtr0AlUI7573DBLWTBEVPwmIPczt9gZIuPESsoyyDuTrwmasHIActAKgUNbQa4fb VZdSVfrz/wUAh5n7NxIYe8CgYdJWkicY7iZpkpQ1um7q5tlLRpRjyn7Z75xaS9XJZDCd OphuIW0tgPLg9COf47PBxxRFTrdzCO+wPwCSmXSnJuoGlRzWptESBAAmLZxBlRLPec2V 81tPtIwmpgDXnJHI8g2Xh+IVARChzy3ktFMZMPknGHAHZvJOPcnuQGhc3Sr8+y0gchi+ SNnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=mo/iAFPJUW8U3KeD57pM8S8YMgyWHyuVJDQcL3dFlsM=; b=slSIh1odc5M31HRdbwlJjDFgQQfxPVqul3apNqASULf0xSNaAVhOU7CIogV96ln6+V /tvEVNO0WYPqKftzcNib9pmz3ZcnCbReWa3nSMs1vWF7PJHE3LrY9FTgXCesNAHQ90Qy r8yTTjMVyNgVMfxwJgWjt2CtV5g9zXydji4FUbpGQ82RRFb7rVQiTpV/VdgF6eiv3S0K jbuZbKLIDPGfUTJoa4JxSIUpjpQhS3CZRasiBfl/+p4umitfWdDdDCuBvlXXLij79uyA gs9BoVRQuGA21zWKq0igUFHkf41sfq1JRWlWGfMM62U/FAyYhgT5BUKVhqGWW6qn8Xeb SvIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qo22si11415204ejb.178.2020.10.11.21.40.15; Sun, 11 Oct 2020 21:40:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgJLCuU (ORCPT + 99 others); Sun, 11 Oct 2020 22:50:20 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:38202 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726098AbgJLCuU (ORCPT ); Sun, 11 Oct 2020 22:50:20 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E62B1613D6B31E5941E5; Mon, 12 Oct 2020 10:50:17 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id 14.3.487.0; Mon, 12 Oct 2020 10:50:10 +0800 From: Jing Xiangfeng To: , , CC: , Subject: [PATCH] HSI: omap_ssi: Don't jump to free ID in ssi_add_controller() Date: Mon, 12 Oct 2020 10:56:43 +0800 Message-ID: <20201012025643.6883-1-jingxiangfeng@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/hsi/controllers/omap_ssi_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hsi/controllers/omap_ssi_core.c b/drivers/hsi/controllers/omap_ssi_core.c index fa69b94debd9..7596dc164648 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -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; -- 2.17.1