Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9044827pxu; Mon, 28 Dec 2020 05:17:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJw32zUtoeZPs9PMlFjHN37KPQKCmJh8f3gXc0H9oomqUJ1D8t9Dm+7RkR+kbqZvet5ape2N X-Received: by 2002:a50:fc0d:: with SMTP id i13mr35730730edr.171.1609161428101; Mon, 28 Dec 2020 05:17:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609161428; cv=none; d=google.com; s=arc-20160816; b=jWHbeBCDt7ewdqUXOGG2EaAN04BTp1u70Auw7zo51wl6zlaZlsaO2mW59TI9u8kvtH vcs6lIhdvZTNVLxbPwuYg7SsuT32vebRLr0A3M0d3KZPL+1FPAhFIPjUCH2XZpuNZbpG 4dIzVNbWC7aBPPJhaNcTl8KYJyW05hIM8yj1VOPKlFeeOo7mUzKinXy9notjvjtpEWZd 3vP/Y+V42ru35i5Og/Q1mklDXUGhvAfO5gvq5dWbvPrdq+LqGcYwA4gq0w5nkOdGYQMO WRyk6FZDVvpmEv7gsGBXszssVv36BnrdfxDqEe9yqB28Ep9NzL5l0cy3WexVZXttwYp8 96ZQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nStih4/SSDJ7D3F2YbqDpNEvLxbaD4w11ns1A8uyymA=; b=wpFTRMYc+mvPQ2i5MWORrZy7+4vpPJ0jVfSQMJd2593OsnzIje/2Pu8hNT45wAzWAG 8UWcJq6bLL8wtcGVbg+kY4AOIXeTlHJSSlX4EcRmY124TX9DRPqkPLZ3adUk6mucSnyg Ovd7TG1O9x4flF0D/4B7k97s5XFSEOLzfcyLcJK2jkdWe+2oSM1KX9Ul2x7QiPy68aL+ CUrqQp1wy4nLFUwpjp8jUmBjtCFGTKr/aZikBTv8N8Mwja9lde+NgTdo7coqFjcb7AKY 0XOWIchednOdyZ7ya9Q9UvclkpjRrhFOZl92SdX7shS2XAZvHTcFy/z11IGEOgwYe/mQ 9WHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QMEYyDW0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n23si18275330ejr.321.2020.12.28.05.16.45; Mon, 28 Dec 2020 05:17:08 -0800 (PST) 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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QMEYyDW0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732174AbgL1NNG (ORCPT + 99 others); Mon, 28 Dec 2020 08:13:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:41046 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732184AbgL1NND (ORCPT ); Mon, 28 Dec 2020 08:13:03 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 911B42076D; Mon, 28 Dec 2020 13:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609161143; bh=8eCHzQ4BLhUXnqS/nK/Jn00izLL+xMFmE2s9i2yfi7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QMEYyDW0qer3BUkKcGPHZYGO83xkyszxK06mMK8sqI8psInUjmCpQTkg0mbkI0wXc eeXEIU7lNSrZORto7o6dqS7DO8tavJaIx1TfkzLjj6+gKH/Spoexmu+sbvrm3FSAL4 2fXWF2Bwv18+l0nWybmW6mV1GJ1aQvpGZxwZauBk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jing Xiangfeng , Sebastian Reichel , Sasha Levin Subject: [PATCH 4.14 116/242] HSI: omap_ssi: Dont jump to free ID in ssi_add_controller() Date: Mon, 28 Dec 2020 13:48:41 +0100 Message-Id: <20201228124910.404259769@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124904.654293249@linuxfoundation.org> References: <20201228124904.654293249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jing Xiangfeng [ 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 --- 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 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; -- 2.27.0