Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3258676rwb; Mon, 15 Aug 2022 22:32:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR5AJpJpm4CDpCoriVBdOfHQyUPmNQ+X6ZPOux2H3zkjFKkNZcYQh2M+kL6qseoDZrj4gvMU X-Received: by 2002:a05:6402:2d1:b0:43c:bb20:71bf with SMTP id b17-20020a05640202d100b0043cbb2071bfmr17359373edx.59.1660627923135; Mon, 15 Aug 2022 22:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660627923; cv=none; d=google.com; s=arc-20160816; b=EBjI/CH7758RJJKY28wayt/9SW0oyshJjcvZzopouEsZOdGrBW/kmAjyEgSAkjIwiE HGKbArKbf1yL9IOi77KMV3QVj27Pscqq8+zDW6sSvXi37meKrkSO2wwNSGGgnKWtwMcc 2zPOa+b3YYZUegJKhjXZyLBSOoV15glYmKrxUPE2RgIs/uiR5mAt+9McOh/Nigat81JD p+6gv4rZMXKgveIdk+MnpLKxJcrJUC87hsLGPI/sLAtkHZKUEp3N5tVLTyKGBsqxNStY 8tre22HMa9Ql+zHoefIiC148JlZKdo9SyTLkNCrZ35a8NfpxFEus0SBd+u0YTYSr225L d/wQ== 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=chEJ01UaxYNm827nV9uLqIAP3DJf96J2x5Xg8wLzdoB9KadVbZ20dkqZ7eDHJ5SCys BIM5Cbzo5KTd8JmwfklXA98EECe2FoxBAYEAVRdsFNhEcld+qbLMTE5oZn0RxLjiiHUa MwW2lOuUWwgwu4XmboIWQIX89DmFJXIIw3rX/dCAodoDPkhlgxsE0/+zA4NVT6JhtcnX W9MSj6J8fAhjJLPyOryQFqlhmIUyUrOrc/EtoWot/msPdjCRv6OcneD/h7SzzDFzNX8e fXjVDlaj9N2SWdDQt6sy7isNDcGArFCssKre/hyiJif10usuKKbkxvd/4QQJKR/rBX9a Un1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="ZdRcUG/E"; 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 ww13-20020a170907084d00b007317756bc04si11104352ejb.1006.2022.08.15.22.31.37; Mon, 15 Aug 2022 22:32:03 -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="ZdRcUG/E"; 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 S229543AbiHPEbt (ORCPT + 99 others); Tue, 16 Aug 2022 00:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230014AbiHPEbR (ORCPT ); Tue, 16 Aug 2022 00:31:17 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 991CD16658A; Mon, 15 Aug 2022 13:22:52 -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 5B312CE12DE; Mon, 15 Aug 2022 20:22:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3059DC433C1; Mon, 15 Aug 2022 20:22:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594968; bh=2iiww0YZVx3IsAfXGgFTGknilWMD0Hkj0gj15HbjlMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZdRcUG/Ec9MbF5GgK36iizLEzsdSEGWOptT35dtYmYr2xtNO7QiTbsi1GbEXQNwFN USm+yZ2Y53Lpz/C/zMk5wl/Aw66DOR/k3Q4+oX41514TM5eqmdjq5A0BD981JKkk2b A6U7i22HsROZXCg47K4aoFhoUimNijKsl7130AJY= 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.19 0614/1157] usb: xhci: tegra: Fix error check Date: Mon, 15 Aug 2022 19:59:30 +0200 Message-Id: <20220815180504.209528033@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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