From patchwork Thu Oct 27 00:06:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= X-Patchwork-Id: 11507 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp558343wru; Wed, 26 Oct 2022 17:29:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+dwkLVW6+o7kmaMn+JBl1FtGi0QDF03DEyeKsQfxiOTpPoJczW/bVCzKOsMoux276BNsZ X-Received: by 2002:a17:907:160e:b0:791:8ae7:4fb8 with SMTP id hb14-20020a170907160e00b007918ae74fb8mr41256572ejc.271.1666830599776; Wed, 26 Oct 2022 17:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666830599; cv=none; d=google.com; s=arc-20160816; b=RGcLMfKygtchZzELG5nG/yntHCCzMq0aH0sjmqTcLV/rqw6yMv+gBr2nk81LRC1weS ViQ5PK/aqgWJXR7qZHrsLR75JcIFwLOQpSLflZZAcVsWWoOpAYYFnUfDxesM+U30yZjU FS7YKL8rvs+tohloiT2udHwx7r4lTIPp9y5y7F6WnBceOe2lqvKI265AbFZg1CZyhuqb fGMPWYBAE9cOXkA0LX97PJ1g1dv8JzpJ+lPUvW/X1kFd3Xkhp3WxkVgnjITiAcYQZV2q W10Mi+rV7ixDrfXYv28jyvkPGofVRp0oC1X0hBjzrP3yinHudknn7ba4BV82P0j5dEC7 IBNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:content-transfer-encoding :mime-version:subject:message-id:date:dkim-signature; bh=559nI6r/wXnW78+Ix7ZFiBIXvr2rez9aTS4bBa/OlcI=; b=lQ8KGpohU5f8tqmAozko9EjOCBzrp2nu+56CiD4/QGbVknFRZ79/9h8gjNQUL7Ld6s ulkru1aeRge3ecX439HY9T1ABylSVyPPF20caD6PtzIhJb3e1l095GkeD0RAF7rboLuE A2sdQn03jYBxeKSfiyTlmcMYqqp+bG+W0IrZ/lml1XLQI118TagusvzCIiXSxgPD5oOA n66zjfGZlbDpf76yDy6ugv+LKOO0cQ0q9l7PJ+68X7X1fCWx244qTWwRzCLaKvcTs3xO T/WVZrC4KIJ+I8Z4ZuPgdrDKPWuLxq8o5W80KfzF2kwLulx3IDNMEA7tJSIerLXNTCEw Dz1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=KuY1fW0O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o15-20020a170906974f00b00774195db4e7si4682719ejy.117.2022.10.26.17.29.35; Wed, 26 Oct 2022 17:29:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=KuY1fW0O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234056AbiJ0AL7 (ORCPT + 99 others); Wed, 26 Oct 2022 20:11:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234000AbiJ0AL5 (ORCPT ); Wed, 26 Oct 2022 20:11:57 -0400 X-Greylist: delayed 335 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 26 Oct 2022 17:11:55 PDT Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1267DF6D; Wed, 26 Oct 2022 17:11:55 -0700 (PDT) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4MyQvF1097zBJ; Thu, 27 Oct 2022 02:06:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1666829178; bh=RSJxyVz8Wp0ZC04fPiuQJGAr4G/ZnkUAptmDTf6i+zM=; h=Date:Subject:From:To:Cc:From; b=KuY1fW0OZvy3E8gkGpnLiHBpnPo2EtFy/+OpEqI3h01ek23eIKT5uD7GsZPLkvnWa Bu7CBlDNBdNPyuWgnmYNLIYrxLjy9i0zJ8+1qKr6C2y3T3JAzcTNB6fyuAZG+RTGzi a/Z2o+e9UqwlV4nXK3rpT6vUP44HzIXj4MZWVqtcT/oCNWvreJQJnaatdYNoPGxgBb GMjcyoMigAvsL1ZO5Kd52FycQ2p4Pfbgj5qyLeHZ2WL3bgkmdcsb0uv1yG4GKI1iPa PDescXJrfWwmg3Kbyoi36KpXERRDUN60YtXPEk9I9kXTMGAKj0nRwdhQ7qK1pLbz/F N0scZAP9lQ4lw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.7 at mail Date: Thu, 27 Oct 2022 02:06:16 +0200 Message-Id: Subject: [PATCH] fbdev/core: Avoid uninitialized read in aperture_remove_conflicting_pci_device() MIME-Version: 1.0 From: =?utf-8?b?TWljaGHFgiBNaXJvc8WCYXc=?= To: Thomas Zimmermann Cc: Javier Martinez Canillas , Helge Deller , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747798563426208285?= X-GMAIL-MSGID: =?utf-8?q?1747798563426208285?= Return on error directly from the BAR-iterating loop instead of break+return. This is actually a cosmetic fix, since it would be highly unusual to have this called for a PCI device without any memory BARs. Fixes: 9d69ef183815 ("fbdev/core: Remove remove_conflicting_pci_framebuffers()") Signed-off-by: Michał Mirosław --- drivers/video/aperture.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/video/aperture.c b/drivers/video/aperture.c index 9e6bcc03a1a4..41e77de1ea82 100644 --- a/drivers/video/aperture.c +++ b/drivers/video/aperture.c @@ -340,12 +340,9 @@ int aperture_remove_conflicting_pci_devices(struct pci_dev *pdev, const char *na size = pci_resource_len(pdev, bar); ret = aperture_remove_conflicting_devices(base, size, primary, name); if (ret) - break; + return ret; } - if (ret) - return ret; - /* * WARNING: Apparently we must kick fbdev drivers before vgacon, * otherwise the vga fbdev driver falls over.