Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9267558pxu; Mon, 28 Dec 2020 10:54:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNg2uW/SHoipF2DX+m1GGWU8utmzy5iCrW5rWqvFTAo0I3hK1TbvEUrDQZK5xg3nROQzj0 X-Received: by 2002:a17:906:d8dc:: with SMTP id re28mr43032666ejb.168.1609181677370; Mon, 28 Dec 2020 10:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609181677; cv=none; d=google.com; s=arc-20160816; b=lQEBGrCdes+WldKbsqKmRo7SkpeTJtqnW5uDX6x4uN7JNUWtolFbG6dN3wMTcxrRPN HQosTTSbBFeOvcw7/f15GeHt8IoEXVCYdUXX6K8ZsaZ/oUv2vbHde0cRrdfQZQO/QaNt ojLFS5JAMZ3p+4kZ2B7yYEpKQTyo53wjcEmJDTlYbIGORAmvKqS80SoiXaKyMjVSOmdH HuRpp8UWbMBv8DJdZ5XGwY5gz1iiwMmzDZ2nBFfNvxQV/Uvftly3052yC17pUHHXSTuA fmXMs18NcAggLOnMixElk35DgVlLa5Ed4l/VnxZAFN4hFoukMD8kpedLFIRT+9a5ozeY 5wvQ== 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=GRuPccKCD+6nfEb7dXCAjmz3jLtH2MRiKLWJfYKu0Jc=; b=Qld3NPrmhH3kZNJILEQqTtSjIP81syA4X7MIEACB+ENoCW0dzGe9O8tW1WzLeH2ZIP MknDdjhdYiUu7lXCRgsgfED5sV/VrEB6F0sscmBUxeCJIsTzUzUdPGvPoVq61MZQJeI6 bYl205bkjKNpD9mCjxQLyZhu0tvggAunHrRXrioyHgTDKy4IpIhdkwn27fsgaIQLVmfQ ksgwlXG/vOBuT/nxeZOYGN9+3Z1pCsh0JRVLUcHqrfLI1c9N+F9miS/v9Yn6K0mZDH2Y 53T/b6bjP1O04mAopv+/itReLp/vlvaUvvQNcrQ9fGd70MOTtShoAvyWE462mW+iMXW9 4P/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QlVSKDKk; 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 qh17si16990206ejb.115.2020.12.28.10.54.15; Mon, 28 Dec 2020 10:54:37 -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=QlVSKDKk; 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 S2404918AbgL1Npq (ORCPT + 99 others); Mon, 28 Dec 2020 08:45:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:46154 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404900AbgL1Npl (ORCPT ); Mon, 28 Dec 2020 08:45:41 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4BD732072C; Mon, 28 Dec 2020 13:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609163125; bh=4jSSyZ0r5+PNBCPZq7Ft0Utddr2hanooyBcC/bmj6EU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QlVSKDKkqoUtPB7V32Vqyq60kH2srrSr6BBmFY8ETw1x1kg7AeyVuenZfBRG5Oe+f VG4Kn3LZaarqH1PaSnPPG4wROIdEpIPqEAtv5XmMFy8ls60HGIVoTrcW/DdyUU4SBW guoL2H7Yd96K2/PAMR59yxEi5/MZpCYuPxELtAvg= 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 5.4 179/453] HSI: omap_ssi: Dont jump to free ID in ssi_add_controller() Date: Mon, 28 Dec 2020 13:46:55 +0100 Message-Id: <20201228124945.814203745@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124937.240114599@linuxfoundation.org> References: <20201228124937.240114599@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 4bc4a201f0f6c..2be9c01e175ca 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.27.0