Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp220630pxx; Wed, 28 Oct 2020 03:13:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2XPGZqcDkuwVsT5p/XMzQoIXer5SCfyKDCfU+GhECzH4ryw4KgAraUs1oB3vmQYN4LRmS X-Received: by 2002:a17:906:af8c:: with SMTP id mj12mr2588221ejb.85.1603880011383; Wed, 28 Oct 2020 03:13:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603880011; cv=none; d=google.com; s=arc-20160816; b=kbkE7m7Z8vMQZLihy4QN26nopdBWJy+PYlvS7Km6FwzmIXxPOHgtm7HNiMhvl7CSfo YOcTVuReyFnv7QTHodLiJ6rOAWTb+39ubz+SJI64LTlQaULK9OAjUJ9Z+VPp3/R+k5lF z2mZtjEF3u1ebwlACSUMq3Yw4mZNO/p3gFjrHmHyjAyv5oJA2X1EvcJmK14vhIVbf7oP ybe7qgRJ2snZ3+b/Y2UUuQFE4lFFgFYgDp0KRsMHq/p+FnmWuJSOvJXv2VMPyFYLpDJp WfsEquZFRgNxvMFFvDP86dp56nX1p7HOsmGSVm+gQFPUf/tU5OHjF1OT2XktNwkJyCTe +QZg== 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=oRfp+A6JfoczDnDaWjhSne8ZnTfmFckfns95sTJyshQ=; b=tZJnvgEzYtcAvIKK+tJm6n14FJM43w5Ywkc7/GvUQBZkaNQCV5Ix+ysD4gEl0EMxP/ r0dNW4nCCl6SwowxTPk5E3AL5jlqZPwZz4Kij9ylS9+31IjjEShOgkHYrY6Q/bow2XZo H7Jw6v2RmnQCReUfCHsvLHWDEhvIwbkvPmSKkaafYn6O0rdCriDRRk+kTmQJuEyHIsgS 9L8/Uw9HAtFCOggCCbwy7sE86AkVimWvn4wORwxzQSafX2zs09CWr26QGRb+kQ+IgoDT ERRXDK2cTAE6oMC8L1AOonn6AWVRGnyGkM7Efpsh1beFkjTj7uMkvulx7NT0yIpiBng/ ybqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DPyPJxWg; 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=fail (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 l12si2820211edk.163.2020.10.28.03.13.09; Wed, 28 Oct 2020 03:13:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b=DPyPJxWg; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760779AbgJ0OgZ (ORCPT + 99 others); Tue, 27 Oct 2020 10:36:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:34624 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760674AbgJ0Ofu (ORCPT ); Tue, 27 Oct 2020 10:35:50 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B2E2B207BB; Tue, 27 Oct 2020 14:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809349; bh=c6pyjhmpCq6DSaXPjXLDNWWwd28gwvUHHbyN54VsoXk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DPyPJxWgXSGfEMLhUu3X18w+kmR5hTxU1h50UWBlAGpMkM3BJTs/zX7kNSqoBrwnD uIMzlhsLQP5mr0NC0iwjqqjuDvg9om42QpRskoz5S9M2TlFmW5KH0Ps0M3vjDDYwGi tenGFUoqagNHSjXqoHzTEpj/OLq2YtSsZQJXlqls= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Srinivas Kandagatla , Sasha Levin Subject: [PATCH 5.4 165/408] slimbus: core: check get_addr before removing laddr ida Date: Tue, 27 Oct 2020 14:51:43 +0100 Message-Id: <20201027135502.757028011@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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: Srinivas Kandagatla [ Upstream commit f97769fde678e111a1b7b165b380d8a3dfe54f4e ] logical address can be either assigned by the SLIMBus controller or the core. Core uses IDA in cases where get_addr callback is not provided by the controller. Core already has this check while allocating IDR, however during absence reporting this is not checked. This patch fixes this issue. Fixes: 46a2bb5a7f7e ("slimbus: core: Add slim controllers support") Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20200925095520.27316-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/slimbus/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/slimbus/core.c b/drivers/slimbus/core.c index 63ee96eb58c68..42a233fc5dc6c 100644 --- a/drivers/slimbus/core.c +++ b/drivers/slimbus/core.c @@ -327,8 +327,8 @@ void slim_report_absent(struct slim_device *sbdev) mutex_lock(&ctrl->lock); sbdev->is_laddr_valid = false; mutex_unlock(&ctrl->lock); - - ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr); + if (!ctrl->get_laddr) + ida_simple_remove(&ctrl->laddr_ida, sbdev->laddr); slim_device_update_status(sbdev, SLIM_DEVICE_STATUS_DOWN); } EXPORT_SYMBOL_GPL(slim_report_absent); -- 2.25.1