Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1865021rwb; Fri, 19 Aug 2022 10:40:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7eDGQE7XQRYI7RIvrdFmdjI7ZETtHstfmuqsHqPdvCaNIaTj1zBAgG99dJ063xe2w/7Cyv X-Received: by 2002:a17:902:820b:b0:170:f3ae:bd0e with SMTP id x11-20020a170902820b00b00170f3aebd0emr8365530pln.143.1660930804259; Fri, 19 Aug 2022 10:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930804; cv=none; d=google.com; s=arc-20160816; b=wrpvFpOe8UOZXbRvm90E8ij0XNVYq+2tYkrVqWe1pm94+AWW8DhXQzPZbr/zVNXbhS CJfsQu3eFAABYaJzcqpbIvpAef/PG/LgxPMSCx51XNLeUEkk/PMe968LNKht27/T1v/Y jmscnK5wzLAiUYgl+Mg81hqZF+l8eGWRHQitGjDjVtlUnCl8Rv347kS9OTqAvJBsiWtw /28TgU8KAv4xkPWRe2LqvDRviNVwZdwxzvdj2jNAcUji57x7LYDVPSOjnHk8KV/m6zJK 5aKdHiXdyfW8mDC7kks5RLcMLwJPa6fQu6uWRDYl38d0mn3k3PdCkdcWswgIrNpzocyw bgqA== 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=Hlii5X4iz0WA8agXeIlerN5XmCyMPXe1iL5tTNczqxc=; b=h9WXdniTMDIpYL7Po2RhVlO0WcrlfRMHrou9TbU2k5CO0sxYJ+dapVNqISOmdpdOKy s9Y3cvA3sDFBTbpga33cwSrWkZsOqxwt5VLHVpMHJcoHJSaA0Hc7aU6hVCyrYkP+Ok5H T3aOWdo7VYwVHaRZhSNJ50g1na20ngk1ZroP6HwiUm0GPasZKJovnzOwzBDG/82IkqkC //srA5sGkL1mbJBGq2Hdx4LCiRquvUpQJ6r9aRmlnhKg1XR7L2HxAAzgBO3xrWKAMziK vfA2l7hkEJHWZSGNF7SVJZhoHrHDMdv/ZTOQIZ9S7zA5nmmgLV25At+p+xeAJbFVwCM1 iyCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G7CgckDt; 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 f123-20020a636a81000000b0042a3acb5b15si2747779pgc.267.2022.08.19.10.39.53; Fri, 19 Aug 2022 10:40:04 -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=G7CgckDt; 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 S1352343AbiHSQXv (ORCPT + 99 others); Fri, 19 Aug 2022 12:23:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52988 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352228AbiHSQUK (ORCPT ); Fri, 19 Aug 2022 12:20:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E84D9108FA7; Fri, 19 Aug 2022 09:01:28 -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 ams.source.kernel.org (Postfix) with ESMTPS id B5ED5B8280C; Fri, 19 Aug 2022 16:01:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DB01C433D6; Fri, 19 Aug 2022 16:01:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924880; bh=OtPWqZkomw1fPfVd90lTptA0F5WqoBTC8rGiNIX4stM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G7CgckDtXpzjXqJKhZU0iUDY4HX/pPW1glEei4SDBYEE6KKrZspWw9UKR+tpTdObf 9TeK2HNeBZeMYQrihJxUykN29zpg0YqnM+Aigj0FxC26ykvJJ7gv6BG1CKArv5MZBe 3VBTo4k+h/pSZp/G9opgzWlPDX+w/bLVcuRWqnJo= 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.10 282/545] usb: xhci: tegra: Fix error check Date: Fri, 19 Aug 2022 17:40:52 +0200 Message-Id: <20220819153841.931627948@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 50bb91b6a4b8..246a3d274142 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -1042,15 +1042,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