Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2195959iof; Tue, 7 Jun 2022 22:52:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygP+uvbLhTZBFwzmSvImLxd6Y2TrYGeDqTagSV5AD2tKO1pBIFTVWK2NjH8aC2j7mFYi1p X-Received: by 2002:a63:85c8:0:b0:3fd:1851:3d67 with SMTP id u191-20020a6385c8000000b003fd18513d67mr23356826pgd.520.1654667579466; Tue, 07 Jun 2022 22:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667579; cv=none; d=google.com; s=arc-20160816; b=xUqXO0n8QxufOzO+mixBk6WsVK96NpKVjQ8Th/m9FNkaAP8mTEi6n5F7oERoGvB80c Zz3lD6zXkPyM7PSiaE62P6xhwGkFeG497gsJpk7mpPJZAuLIjlKfjuvRLwvE6ZHNWkzC oo6FcQN1LuP1HuhQywjbfFJNj//DzyF0NXey6x7Bs/m4IcrbANFqPZAFd7LTKwyy0IcY TeF0ODTDMRKBpLo6w1lRunlt/G1uCKrvtulOA/Av7GzTK8ioaR17gqRW4BOqSGV5XM9o VU2kLaFqISRSjhdCfbhHiwJB97UW0NFe7QmzvDGMJS4KCYlf5lY4nMNpX9VWaVUh+TGb kDrw== 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=W8tPbhhv5yD3sF0KRKzbHWhQ23Fh6HZBU1AiLj75Xo0=; b=g97djpQ65QgQ/a1/bmP78NBhOUKt+WT0+FIsU8s0F3QekECSO28MfRqVq7muS74wH5 RLTw+wM2rV61lDzcsxkoFyuXJxVahi6vOWGUSXa9xYtRhTCl7bXto3uYw0p2gmZOgC9c Js4XJdqg84JQJGXfTaZnEGVGoHQ8fSMwjoRkDjy7+s0S+WOmeBM5CTESQapH/qOs66Cz y5smbdTMKD541HLdhMY9ALAUYuQ70GbdxougnMc0+AzthedAed82XSSUVKkpyP4LC4PB CCVM7sssnBE9RL4FMlK9XJYGSAi/89tXTwRBvFnDG/fHKq3fJB3YZAhzcRMkZtfP/kJG zP7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gMWtfw5B; 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 q9-20020a170902eb8900b0016223c6e629si22980027plg.235.2022.06.07.22.52.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:52:59 -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=gMWtfw5B; 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F02434AEE8F; Tue, 7 Jun 2022 22:21:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442809AbiFHA5E (ORCPT + 99 others); Tue, 7 Jun 2022 20:57:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383122AbiFGVwT (ORCPT ); Tue, 7 Jun 2022 17:52:19 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EF3C2428CA; Tue, 7 Jun 2022 12:10:33 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4611CB82182; Tue, 7 Jun 2022 19:10:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3AD1C385A5; Tue, 7 Jun 2022 19:10:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654629031; bh=qXt8HYzvC389/LYL+hw9trysoaLCoG40Dj9ZAx+tflY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gMWtfw5BfygyZCU6xY/yA/trrls5N8ENxd2jkX8y0C3NatWW67gyCujUg3QS2yvJH Mzh041MAZip4r101TbTO1DfW3nyY/vYb85v6onysbs7yEROJBocSBAz+hNz1zlIueO Ly8FJvWyqWCC3/idUA1knZyTs6buRC6sMhx21P4s= 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 542/879] PCI: cadence: Fix find_first_zero_bit() limit Date: Tue, 7 Jun 2022 19:01:00 +0200 Message-Id: <20220607165018.603099483@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 0aa3a0937feeb91a0e4e438c3c063b749b194192 ] The ep->ob_region_map bitmap is a long and it has BITS_PER_LONG bits. Link: https://lore.kernel.org/r/20220315065829.GA13572@kili Fixes: 37dddf14f1ae ("PCI: cadence: Add EndPoint Controller driver for Cadence PCIe controller") Signed-off-by: Dan Carpenter Signed-off-by: Lorenzo Pieralisi Signed-off-by: Sasha Levin --- drivers/pci/controller/cadence/pcie-cadence-ep.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pci/controller/cadence/pcie-cadence-ep.c b/drivers/pci/controller/cadence/pcie-cadence-ep.c index 4b1c4bc4e003..b8b655d4047e 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-ep.c +++ b/drivers/pci/controller/cadence/pcie-cadence-ep.c @@ -187,8 +187,7 @@ static int cdns_pcie_ep_map_addr(struct pci_epc *epc, u8 fn, u8 vfn, struct cdns_pcie *pcie = &ep->pcie; 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); if (r >= ep->max_regions - 1) { dev_err(&epc->dev, "no free outbound region\n"); return -EINVAL; -- 2.35.1