Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3722030pxb; Mon, 24 Jan 2022 16:19:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJy90c1F+PQSswvRoa6p269TS9X8whdUnvJ15jFPJYkjTKQm5B6lUDVQSSwZO9Aw/bfRHAlV X-Received: by 2002:a17:902:b40c:b0:14a:792:741f with SMTP id x12-20020a170902b40c00b0014a0792741fmr16476931plr.113.1643069965116; Mon, 24 Jan 2022 16:19:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643069965; cv=none; d=google.com; s=arc-20160816; b=t2CIwtghjROJV6YI6V0aBVrvUwy6epFXKduUf19r2U7zbR6gDAZDo2MKOmep1IjMCG 2xC8Pkm4lo6S5nIRbtg+cnge+93CN6FLi1YfkWqj4gmN08Ujo/U530QQ7aPr6J+d8Pmu cTBUG7ZjWlF7RA7is8WT04dvydUaUK1P4IcghanUnoVNXTxZVATnQXuaDCM8vtLpiSo3 BwuAMBW+5HecRNVv8oAYjWDsE5dA1CqRy54gf2iaqUHlhrg46m2p9aTiuWXihauOJygK 329jD/IUox1CCRDR6byrMO06+tUK8BL1hokQavAyK1yJlntv2ARee1F4xLDEFGF6DpxB 0uHg== 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=sOqknFn6tZZrcNVmVYaBJjmzV3i4g47mR+lVYmXUfgk=; b=cqqiF0XeDubwiOhNS4RVd4iPVkorD7Z35V+K+5K6jOIxsIy7J7Tinkc3ylgJxFUJVb 20yOezsq8ntACGMeAc5YAvnGB7fWMH+6nRmK99xnN8HHKb5HG3wET7kfI0wyTvYHsn9s nhizvcE2DAm/sp1cuaJ87XY5UkqsnkfyUWOSlMSXJhlqqKZ6NsldbTXabyK4JE3bvsYQ AK2qDWhODddCaYINCEuyruKqwR62At37+fDDS+evHXJ7SaiCKVxrLNCTLw/1lxogtnCF 1qnkyqkTG5oSMt6HHlfwSRkwef2ACFc8iFrazucU0LQLSp11XNHKQV8+UXiJPS63ePM2 F64A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dVuXuEas; 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 o5si2663087plk.247.2022.01.24.16.19.13; Mon, 24 Jan 2022 16:19:25 -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=dVuXuEas; 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 S1850382AbiAYAO0 (ORCPT + 99 others); Mon, 24 Jan 2022 19:14:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1574952AbiAXX2Q (ORCPT ); Mon, 24 Jan 2022 18:28:16 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DB0CC0A54D8; Mon, 24 Jan 2022 13:32:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EFC34614B4; Mon, 24 Jan 2022 21:32:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D39C5C340E4; Mon, 24 Jan 2022 21:32:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059968; bh=VbmKCL72Oen/J1WzvyZ7/8kn5y0mhpkYsLrA1c3G/+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dVuXuEasMtNxKDtdlRqxosHouSm+fwkiO3xa+d9Cbc0cx15F+aGZj11IUP4A9SXWC Ol8sLlArhao7vbUmJ4dZeJ0xyMqee5C8PhBPA4pMyoO++Xl6hnSNQgnW5Ew4KqXfMJ 48v/r0aw6e51WXrAL7eFk13nPjURuj25mtNMCjnU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Boris Brezillon , Alexandre Belloni , Jamie Iles , Sasha Levin Subject: [PATCH 5.16 0794/1039] i3c: fix incorrect address slot lookup on 64-bit Date: Mon, 24 Jan 2022 19:43:03 +0100 Message-Id: <20220124184151.985072196@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Jamie Iles [ Upstream commit f18f98110f2b179792cb70d85cba697320a3790f ] The address slot bitmap is an array of unsigned long's which are the same size as an int on 32-bit platforms but not 64-bit. Loading the bitmap into an int could result in the incorrect status being returned for a slot and slots being reported as the wrong status. Fixes: 3a379bbcea0a ("i3c: Add core I3C infrastructure") Cc: Boris Brezillon Cc: Alexandre Belloni Signed-off-by: Jamie Iles Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20210922165600.179394-1-quic_jiles@quicinc.com Signed-off-by: Sasha Levin --- drivers/i3c/master.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index c3b4c677b4429..dfe18dcd008d4 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -343,7 +343,8 @@ struct bus_type i3c_bus_type = { static enum i3c_addr_slot_status i3c_bus_get_addr_slot_status(struct i3c_bus *bus, u16 addr) { - int status, bitpos = addr * 2; + unsigned long status; + int bitpos = addr * 2; if (addr > I2C_MAX_ADDR) return I3C_ADDR_SLOT_RSVD; -- 2.34.1