Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9036600pxu; Mon, 28 Dec 2020 05:05:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxJtVbyy017ycL8ljKpuAIKRdMprhqAw0dX9DQt+GnRcSsKiUrPhRw98/HlcRyee9zeewV X-Received: by 2002:a05:6402:513:: with SMTP id m19mr42219913edv.244.1609160716823; Mon, 28 Dec 2020 05:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609160716; cv=none; d=google.com; s=arc-20160816; b=QIqa4MyubufX6YVzfuaK9vcnJqRoQ3EDY7vs5JS/aDl+q6NqZXLkESNjGqpEB1RGSN /9nAtDjEsvm6kBYMomdXGipiVTDPdVtVt8ph1FcGQ8YMelWh8Qgc1WImdhgZhg84fpJC uW9jOTKDqsFkoAfMhiR9e3FMh75TeppzpV+ZNdj9luSvMDWDEkOe4sBnbjipqZcuzKot FMqa6b16lstKeGyiLzpzO7R4kuMlL4R34w8vc+Md95O/nmS3pu18ag8N6aCXNzeACQ1G wuh14lCbB8rbcHX0ovN1krAzWH+mU75oYlZm64fNQ8FIxLu5iWQee0bBlNh2MDuhOLOB TuBw== 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=MmI3dDbGiQK8eGDpUVzLRXn/Iy7WIHfpCp9+Mlfcws4=; b=iaZP5wGiB7JMiyNkut6mJLwkjwJtOzMhn1NIiyfTQLvBjz3BVP0nFQzOMf47dmbZpK cIbq9cKNnzivNq+cxTsdci7Ue6177w35xEoqPKFPshgB+RAoe8nGo8T/lcrdO+n1Jb70 Y7k8CtL/808bx6kl/SlHelyJzvwtIWxFkGtrPU317bcl2YH35sk1IbkREzsPJofoUe8A S4f40wKmR2U+jchU/nAapREQW2EZGmltn5a4K/OPSjSGsU5kL+NCoL/d2UcA3H7ILOHc VsFPZ2eXrPd7eeGalCBYW2VBbLAUtc8htv8VKsY+1HHxK7jxmSCOoOyYq0ok3Oi0Zdr9 zGRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tAmKGdbf; 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 z22si19114123ejo.390.2020.12.28.05.04.53; Mon, 28 Dec 2020 05:05:16 -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=tAmKGdbf; 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 S1729099AbgL1NCr (ORCPT + 99 others); Mon, 28 Dec 2020 08:02:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:58244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730111AbgL1NCg (ORCPT ); Mon, 28 Dec 2020 08:02:36 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 840D3208B6; Mon, 28 Dec 2020 13:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160541; bh=DHj/ZKV+fJ20N51NHcGxptF1iAO6LZ9Wh37cjrB0aZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tAmKGdbf8fRKu1gZvBlVidMgpsah75MfiPZzwBywhQ5rOrTeKQkNA33aBbuC+ELui vRWOtqbKcubLKrcyorTLRbv46a2/8ROMeEoH2VYIWJA8AX02VY0JFcXmib8yKmgO// xOpUUrBZMAxIr2qFlg2oiIXYHVlOmsdbvbjTTyMU= 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.9 084/175] HSI: omap_ssi: Dont jump to free ID in ssi_add_controller() Date: Mon, 28 Dec 2020 13:48:57 +0100 Message-Id: <20201228124857.312961290@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 9a29b34ed2c82..22cd7169011d1 100644 --- a/drivers/hsi/controllers/omap_ssi_core.c +++ b/drivers/hsi/controllers/omap_ssi_core.c @@ -391,7 +391,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