Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2200484iof; Tue, 7 Jun 2022 23:01:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5z0Mjgc0Daz/WXxy3h/pbTLfav83zF8hA4IKNJML8y1qlbjNoNSZcPOUzM6YuTFZvp45U X-Received: by 2002:a63:114:0:b0:3fd:431a:dd77 with SMTP id 20-20020a630114000000b003fd431add77mr20595903pgb.619.1654668117712; Tue, 07 Jun 2022 23:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654668117; cv=none; d=google.com; s=arc-20160816; b=tsIBvsYug7EzzA8mpuRHbqCrOzS1hJFW75bMA/jWkJBMDHOFlcMFwS/y9U+I7mdjHk DWkVe8aYENCyaVAp/oHUsWtgVSPbxZ/hWqZTfMglK1gT8hIm8JJkEnNHdIv8SNFQSIUJ wiFCTtzSgMM8S4ykykFZ5kee/b6dj0qxBgknuhS0OYXeY5TNVhxsVQ4ruHAyRs2l3lde YmzTlLYhKqbHJC+siYWq1IF8NwtNZQCclKzywHND1doi73RHeLbmXnNQGjTtgMykNAt4 zv5qHadrs3KcVn5/uWEAKky+6bO8Lduf+aDQueFzfietgwZrqiDurFBUJKCVGt8Zm1wx GgRw== 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=n/xT8sepmcUKAqf1/aBz0Kc8bpm4B2sBIBkefZA5PCI=; b=B6H939U/nkzJItH0KbjKK8HkVzLa8uC10UKFhuVCz6y2pSa/h9rMGV5xtWF35+CjJP rmExhJBeH65I0xqhvQ2aAj+aPSj14sYhVg/5Pcl800blMnfv1RtE62WLzzBMrv5ILety lrnOLUg6tpE0HK8/EjRHQ+rAn9/UsCo4kjpmka6HtluiBwsvTMqZM9eRYtgJgOwDKRpu P/8rx00RUaz3ikEHNiyTDlKt46qK4+wbviAI/fCqy3urYeWNS34NRMNCBu/lWXDcOjn7 qgyYgBn1lznnNpXVDzJUdoMV1LO+1IM6MRCIR7CLCqa9UCu7UadMe29d27P+gwtJPiGk seRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C9pfNnba; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k13-20020a170902c40d00b001586fbb2b6dsi34420700plk.566.2022.06.07.23.01.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:01:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C9pfNnba; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 590F5217606; Tue, 7 Jun 2022 22:26:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1444777AbiFHBH7 (ORCPT + 99 others); Tue, 7 Jun 2022 21:07:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1384289AbiFGVyZ (ORCPT ); Tue, 7 Jun 2022 17:54:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96A6C24A1C8; Tue, 7 Jun 2022 12:13:19 -0700 (PDT) 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 283696187F; Tue, 7 Jun 2022 19:12:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 326B4C385A5; Tue, 7 Jun 2022 19:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629166; bh=RwPRQSyV833cnrScno/aj01YrPInxnibRG2Rvh6F6Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C9pfNnbaFh6tCxsJwsE1Ea1sBsXSLViGMJlc2gg4YdE1CrT2G7SBwJzjP3itpGxWK cS59g07JJDfd7vO9R/YLDdxRgegfDNXQBiA7IPCRY/3cpkkPlESDAbmtn8adyroBbT kfDbs/i91/0I2/fLhQ+Oi9iUrkNw/eDFaPVaubzY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Lorenzo Pieralisi , Sasha Levin Subject: [PATCH 5.18 543/879] PCI: rockchip: Fix find_first_zero_bit() limit Date: Tue, 7 Jun 2022 19:01:01 +0200 Message-Id: <20220607165018.631420265@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 096950e230b8d83645c7cf408b9f399f58c08b96 ] The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits. Link: https://lore.kernel.org/r/20220315065944.GB13572@kili Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") Signed-off-by: Dan Carpenter Signed-off-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-rockchip-ep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-rockchip-ep.c b/drivers/pci/controller/pcie-rockchip-ep.c index 5fb9ce6e536e..d1a200b93b2b 100644 --- a/drivers/pci/controller/pcie-rockchip-ep.c +++ b/drivers/pci/controller/pcie-rockchip-ep.c @@ -264,8 +264,7 @@ static int rockchip_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn, struct rockchip_pcie *pcie = &ep->rockchip; u32 r; - r = find_first_zero_bit(&ep->ob_region_map, - sizeof(ep->ob_region_map) * BITS_PER_LONG); + r = find_first_zero_bit(&ep->ob_region_map, BITS_PER_LONG); /* * Region 0 is reserved for configuration space and shouldn't * be used elsewhere per TRM, so leave it out. -- 2.35.1