Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3857290pxv; Mon, 19 Jul 2021 10:23:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxauoyDyBuiUaDeuk5PKnFxS66eT+qg6Z2r4S6R4XnfzXWmBnDQkBB3MavBoNrOn7cZe5R X-Received: by 2002:a50:fe95:: with SMTP id d21mr35683623edt.257.1626715423150; Mon, 19 Jul 2021 10:23:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626715423; cv=none; d=google.com; s=arc-20160816; b=Nwo4h3+UNZBN+2gsexbNJFNGjhLVHZqhjqe5UXLDQiSA6tOnGTVZLIyDZMoSdIOA6h ME9KQR2+hnSp5Ekovxj5cW4Bv3lZ/pSI/hZIvL8Ko3528EyfmzZ0o6S+MspS8DAyGczS hr4RfGnwPWSej/a1GGmUjSVWnXq5juBBmzQ7IaPtB6OwN2dKMB8nILDPeNOHe0Pi40d0 mI7WHS30DUiVyfBMmbnPu89dLmcY4CTtNoSyLRH2XQSI64W5SkNCBkPKSl9GaXauccX4 BZsn7YitN8I4j3LTB7vBG83siWxaAsNy0tYmW5nYF6gwrFsxnwQDsBHoxwPxp2fbvy/K DSCA== 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=yha5S1cltCOl8rhiUI0NUAxInRWp76EpL3IYjWaT3yU=; b=BNIfllqdeL2Vd+2dVAEfxBxwbcNwZuR85yOcTMuttevzy3Z0pObBiZMJJER3/M8cjr TxaUJfACmLbxMyhB4KqXR5OmtpXLYbObHRgJ1fsts1RoI4sgD2qWuPMwUvI8P+RgCsJT V6HT2niHUZsRv1DzHJyRrP337XNz7PZuUy529B8D54UWStsvzVyK11DbOzThftl8uii5 Rh2k14ySZm3xmRLCYcuTjwBIep5XQXTwDrLLhoZxj1hvAlRVkPp3JX31vgealHVcOLOG fuhKsGlVmMN8qBXeys+h1NpA7+Ghu/PDLe/FW+YyiWvkOsLo50G36w6qGuUFDuZeoKGb 13vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="h2/8GYxS"; 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 mp6si19760763ejc.384.2021.07.19.10.23.20; Mon, 19 Jul 2021 10:23:43 -0700 (PDT) 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="h2/8GYxS"; 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 S1356091AbhGSQkh (ORCPT + 99 others); Mon, 19 Jul 2021 12:40:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:58336 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346912AbhGSPSU (ORCPT ); Mon, 19 Jul 2021 11:18:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1A1276135D; Mon, 19 Jul 2021 15:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626710291; bh=SIeiKKr65/+iePijq9wHcz1W/ALmD3TMh+937v8EIEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h2/8GYxSeR7a58F4lMIHMRMt7H0lBrECzbiznPYoE3XyVoJnLxBBFM4Z9oKS1DzFG /Y7wWeosZRXmbz19OB0dnwCKTVB0Y1zZqwtyuj0QvimNvzjUMoGDWRIm3JOSjQewer uFDIdIdAQ2XSDfXThhlNFh4i1To1YkOD9Tn1qkI0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Colin Ian King , Tong Zhang Subject: [PATCH 5.10 156/243] misc: alcor_pci: fix inverted branch condition Date: Mon, 19 Jul 2021 16:53:05 +0200 Message-Id: <20210719144945.947068255@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210719144940.904087935@linuxfoundation.org> References: <20210719144940.904087935@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: Tong Zhang commit 281e468446994a7672733af2bf941f4110d4a895 upstream. This patch fixes a trivial mistake that I made in the previous attempt in fixing the null bridge issue. The branch condition is inverted and we should call alcor_pci_find_cap_offset() only if bridge is not null. Reported-by: Colin Ian King Fixes: 3ce3e45cc333 ("misc: alcor_pci: fix null-ptr-deref when there is no PCI bridge") Signed-off-by: Tong Zhang Link: https://lore.kernel.org/r/20210522043725.602179-1-ztong0001@gmail.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- drivers/misc/cardreader/alcor_pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/misc/cardreader/alcor_pci.c +++ b/drivers/misc/cardreader/alcor_pci.c @@ -144,7 +144,7 @@ static void alcor_pci_init_check_aspm(st * priv->parent_pdev will be NULL. In this case we don't check its * capability and disable ASPM completely. */ - if (!priv->parent_pdev) + if (priv->parent_pdev) priv->parent_cap_off = alcor_pci_find_cap_offset(priv, priv->parent_pdev);