Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2878570rwb; Mon, 15 Aug 2022 13:09:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR7u3688W7eL5dUWb//VDISSOVUZw3VRTPqdv42fuNqzOLDB9xutdwgDlRblvRisNZPH9U0K X-Received: by 2002:a17:906:93e8:b0:730:9e5c:b45a with SMTP id yl8-20020a17090693e800b007309e5cb45amr10811689ejb.530.1660594177585; Mon, 15 Aug 2022 13:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594177; cv=none; d=google.com; s=arc-20160816; b=yDDhgqXua34/i4IEzy9a7N2Yceh8JT+b8I87f25eCXCG0XUJPbpVJwM8+CpFuMi2fi 7nLb2U0e4feMbB05LGdJ6pv2BH4Nbx8fovEMI7G6bkvNJJM8qTK0TOSBJz01BlSrynlg uD3Q8CUOUFdheQoar1Kij6lbHQ3PhoQoWL3Px5S7yKKpYJGjZ3nmR4jVkCVzYXu8UCzX icLEgbujDDWRpWS04nO2fwdZUV9ygdKUcg/6n5haVCwOaAQd7Qi6Ciu/r+L14WTCzCJN GtvUX4hoOmtyjR0khsq9U7p4AmzyHe5f46RR5wIzNGUfhOBFQQMf+9v8E8qYlBWGz92P yt6Q== 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=iKQdj+94BazTVlfCcoWFg6sk/zTPq/DyIQh54DRKOok=; b=I0Zyi62xZk4JJFAsH4k8MXKBeJEhaJ5WL/HueO7PHr0Zv7AzlaxM3Co9dbxqDJeKTe RTRIHZT2+L4H73n7LDZS4Z70S5CapVh5ZjByzDOhEIqHQz5vO4h1JZtXSZpwxw5nISnP bwQBzSPSiLadX4gFNconvzR75srykm78EsnOko51B25h5nw722bO0LPuZeDJc4vOJzn1 2kRxdYJFa/vEturC8CDkDrBN4h8yU/QIwWmwIb9BpWA9mPdXtvO7s0x5ttKcCLo06v7E TUHSIdRWE/aFZQ56gbe0932Xre91cUDuiR+GOIOd6+lEKa6cgXa4hqd5anZXDI4/onj3 9Q1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kiLSSLT5; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dt20-20020a170907729400b00734bc2f6bb1si9455756ejc.801.2022.08.15.13.09.11; Mon, 15 Aug 2022 13:09:37 -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=@linuxfoundation.org header.s=korg header.b=kiLSSLT5; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245515AbiHOTJH (ORCPT + 99 others); Mon, 15 Aug 2022 15:09:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245675AbiHOTGD (ORCPT ); Mon, 15 Aug 2022 15:06:03 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2796637F96; Mon, 15 Aug 2022 11:34:46 -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 sin.source.kernel.org (Postfix) with ESMTPS id 78A86CE125C; Mon, 15 Aug 2022 18:34:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 530B1C433D7; Mon, 15 Aug 2022 18:34:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588482; bh=2iiww0YZVx3IsAfXGgFTGknilWMD0Hkj0gj15HbjlMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kiLSSLT55mZSkfR1A0k4Oo6FCx8lbsMnmAuphoEhjb/RcpzMfMV62kdiRo9BD+yoB gzRfy8aTICj4SpX6LJj3o/FEf0LVRW3JSU4GNABekvl2aMz3x2R6Vi4WsGXcswp0Yj JNuTc3PZ9OtM7s7MKFrhSzOGlYW3Zl3uTQ2aDPi0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tang Bin , Sasha Levin Subject: [PATCH 5.15 417/779] usb: xhci: tegra: Fix error check Date: Mon, 15 Aug 2022 20:01:01 +0200 Message-Id: <20220815180355.086689663@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Tang Bin [ Upstream commit 18fc7c435be3f17ea26a21b2e2312fcb9088e01f ] In the function tegra_xusb_powerdomain_init(), dev_pm_domain_attach_by_name() may return NULL in some cases, so IS_ERR() doesn't meet the requirements. Thus fix it. Fixes: 6494a9ad86de ("usb: xhci: tegra: Add genpd support") Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20220524121404.18376-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/host/xhci-tegra.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index 996958a6565c..bdb776553826 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -1010,15 +1010,15 @@ static int tegra_xusb_powerdomain_init(struct device *dev, int err; tegra->genpd_dev_host = dev_pm_domain_attach_by_name(dev, "xusb_host"); - if (IS_ERR(tegra->genpd_dev_host)) { - err = PTR_ERR(tegra->genpd_dev_host); + if (IS_ERR_OR_NULL(tegra->genpd_dev_host)) { + err = PTR_ERR(tegra->genpd_dev_host) ? : -ENODATA; dev_err(dev, "failed to get host pm-domain: %d\n", err); return err; } tegra->genpd_dev_ss = dev_pm_domain_attach_by_name(dev, "xusb_ss"); - if (IS_ERR(tegra->genpd_dev_ss)) { - err = PTR_ERR(tegra->genpd_dev_ss); + if (IS_ERR_OR_NULL(tegra->genpd_dev_ss)) { + err = PTR_ERR(tegra->genpd_dev_ss) ? : -ENODATA; dev_err(dev, "failed to get superspeed pm-domain: %d\n", err); return err; } -- 2.35.1