From patchwork Wed Feb 26 05:29:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 1244685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48S4BN5PdGz9sPR for ; Wed, 26 Feb 2020 16:30:04 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hll09Rmg; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 48S4BN4px0zDqbx for ; Wed, 26 Feb 2020 16:30:04 +1100 (AEDT) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::442; helo=mail-pf1-x442.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=hll09Rmg; dkim-atps=neutral Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48S4BC5SCRzDqbm for ; Wed, 26 Feb 2020 16:29:55 +1100 (AEDT) Received: by mail-pf1-x442.google.com with SMTP id 2so833651pfg.12 for ; Tue, 25 Feb 2020 21:29:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nwmYVHjUPf/Bmi2Ov5Ca7EtD9Xp+6+Qjoh/PbOFrJbg=; b=hll09Rmgn914HJO4EtuW4xafhJQpItHC9p3DGIsdYW7i4t+qLgVa5ivwMj7lL3AFly AyO90a7wlQCPyN+HidFwhaSRs94vr5+iipqe+YShSryjr5FVDEAudvid7gLbypXePWS7 Kpzwz4FIAGTFIdQgYFIwDWDOd6FFZz+EHvZ2sQBwoE9XsnDFdYTbmNvZB3w2GM46VmrS MGWWvBtFfOU4Ug69Jg+eZrS/b30bCXUjyQrlz/Zu/8ZsAJmFNDApgrw7J65Hjj1IC176 qL/RntA9UUSB93WxHIShxQUEXJCRwv8vkeKDcWSvL296+7yGu/cZsgS8r/XO+FjJ246p zroA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nwmYVHjUPf/Bmi2Ov5Ca7EtD9Xp+6+Qjoh/PbOFrJbg=; b=qtk1AA+IiyNEVyazitWqK9OvXMhClVmOeMwNCMlTBrAPgEx6VEKcPCI+DQgdi5GW7B xyJDod1i1IPyDk7We3jUCqAj+cKCD9/5YwLBq9YrYOyrJLnLnyxGNMMpkg+ZGgHt/iz7 eEUJJY/MwLatdOQlfAPO7uoSwhyD/wcAJX3VYjtJrzBY+qRWEpyLnHoX7r0iuMhCRqq1 ule2ALLMvcON1cr1jYdfpvHU5NEDxL0gDdOBr1LVVJSAHiVrd0UJNvc/FAwVXkA0dWEx +KB1IzoqrUgkkG4I0lEvXU1t0lLQXR/i3py/nNO2O7Pplj4hQbWgmGtx7nDvLqyRaLAL /0pA== X-Gm-Message-State: APjAAAUMdL7e5RUSkwl1/1RBkkHrq5UX++eqIR9JeKax3vkl/IMr0XA6 wf/iltngtJ6ZZKvu/7HrJa5ubNe6L7U= X-Google-Smtp-Source: APXvYqzW1TVwuHlubFZvvSJ/JGrh4+8CrQOc2Vqj4F8WIl/fY9r2ibo6eB+VnO2PtARzO7nmOFHWig== X-Received: by 2002:a63:3d0a:: with SMTP id k10mr2025246pga.233.1582694993049; Tue, 25 Feb 2020 21:29:53 -0800 (PST) Received: from wafer.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 72sm1019385pfw.7.2020.02.25.21.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Feb 2020 21:29:52 -0800 (PST) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Wed, 26 Feb 2020 16:29:34 +1100 Message-Id: <20200226052934.9221-1-oohall@gmail.com> X-Mailer: git-send-email 2.21.1 MIME-Version: 1.0 Subject: [Skiboot] [PATCH] firenze-pci: Fix infinite loop in firenze_pci_add_loc_code() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" If ibm,slot-location-code isn't in a PCI device's parent node the loop to search for it will never terminate since p = np->parent is always going to return the same result. Fixes: ab1b05d29f5e ("PCI: create optional loc-code platform callback") Signed-off-by: Oliver O'Halloran --- platforms/ibm-fsp/firenze-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/ibm-fsp/firenze-pci.c b/platforms/ibm-fsp/firenze-pci.c index efbe5525da4b..12e0e98991aa 100644 --- a/platforms/ibm-fsp/firenze-pci.c +++ b/platforms/ibm-fsp/firenze-pci.c @@ -987,7 +987,7 @@ void firenze_pci_add_loc_code(struct dt_node *np, struct pci_device *pd) * prefer fully-qualified slot-location-code, walk-up parent tree * to find one */ - for (p = np->parent; p; p = np->parent) { + for (p = np->parent; p; p = p->parent) { blcode = dt_prop_get_def(p, "ibm,slot-location-code", NULL); if (blcode) break;