Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1862388rwb; Fri, 19 Aug 2022 10:37:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR5l02RC7m4odZOgImgoFOqpySBhqVVwIMSXKX09zdr3pjfWxvxrnPhilDH3uKibhE1BYldp X-Received: by 2002:a17:903:2311:b0:16f:2420:dde4 with SMTP id d17-20020a170903231100b0016f2420dde4mr8173718plh.20.1660930636569; Fri, 19 Aug 2022 10:37:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930636; cv=none; d=google.com; s=arc-20160816; b=UpzdG+ZQD45Du84Cxo95uLJ9alCKnTgZQAOTX4BlgCEwrlUJTvpDqIHKx4yb5M/CCG 5JhvSHDq4P27Zmzi+nZF14s25EO0LQvHsY08Mjl4gk91DpAarr5kP7qRinkudBcXq7zb 1qDgNh6VgRFIkSLWOSiS6+fWp2/rhX6eX1P6NXbPdP7MbtRfTyEmVU+kc80DGqxnPmyF 1S4V0mfEu0Db4tVk5zxZnkFCJQkxD5JteCOtSYuiVs94IbcQ6Sd1soKCzubTnxOvHXi8 ivsANrZwvE+7pBOBGQ4n2wz8O6AXG8WHKBPZcgeEccml0D6FKB9Ofe9wdt5SQVwTnD6/ Mv5w== 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=Eo/bUxc7jJI+yqNeq2t9XeAwoe+sqfFeXSkEB4W7PAY=; b=Wyllgg0nSVvuRKS03O+WXPfsm5PrR2mdU5hjfOCRxQTLEAsrOA5siAdS+Q1bDoBfOO YR6wvy//LmaeGS2zWrQ5B9TlMqyMaZ17nQgUeU0aiHjmexRkzIPyOQbeTbpDLIaNowQt N6QMpyoS9O6qQwM+3n/4WXWjCj7JxzYBOslhY1dazSDp1Jixmc8kqlCIEg+BRK64YBLl GhPibNd4UuvOoUc+0XoiDUXkMe2ax2BdOqBZSUwzg9NZHSZkLE2jJ/uYHqBC/XSZd0v5 c4iZKVErIaZJkRqtFq1JksfAQtV0F+SEhCe/0pJA3gT+X4FoCKvTjpp12zVdqLcJacZd x6kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RIzjmkDd; 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 j9-20020a056a00130900b00535bfefd390si4954296pfu.303.2022.08.19.10.37.06; Fri, 19 Aug 2022 10:37:16 -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=RIzjmkDd; 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 S1352625AbiHSQYX (ORCPT + 99 others); Fri, 19 Aug 2022 12:24:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352306AbiHSQUe (ORCPT ); Fri, 19 Aug 2022 12:20:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC343EC4EF; Fri, 19 Aug 2022 09:01:18 -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 dfw.source.kernel.org (Postfix) with ESMTPS id B8A0A617A5; Fri, 19 Aug 2022 16:01:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4D9EC433D6; Fri, 19 Aug 2022 16:01:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924877; bh=Rb4IuH7qbdBC3csFboi8CTFe/x5QTqmzTvRnL83eiIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RIzjmkDd1kKcawH/fdwoi7kVX15aeGiPhUunPHE2RbE8+hBEPnv0N2HFyMWViOIz7 +uowJ2P0DPadbXo1H/1kCdw/C8WSL39wiQ7Kax3pFMbfUDx16w8X7FxvQxIV2SdXfS cXgFFlS029QVGeE+di9HEIIG8UoCF6VS1sOjAhiY= 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 281/545] usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init() Date: Fri, 19 Aug 2022 17:40:51 +0200 Message-Id: <20220819153841.886856141@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 f08aa7c80dac27ee00fa6827f447597d2fba5465 ] dev_pm_domain_attach_by_name() may return NULL in some cases, so IS_ERR() doesn't meet the requirements. Thus fix it. Fixes: 49db427232fe ("usb: gadget: Add UDC driver for tegra XUSB device mode controller") Signed-off-by: Tang Bin Link: https://lore.kernel.org/r/20220525135332.23144-1-tangbin@cmss.chinamobile.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/gadget/udc/tegra-xudc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/udc/tegra-xudc.c b/drivers/usb/gadget/udc/tegra-xudc.c index de178bf264c2..3ebc8c5416e3 100644 --- a/drivers/usb/gadget/udc/tegra-xudc.c +++ b/drivers/usb/gadget/udc/tegra-xudc.c @@ -3693,15 +3693,15 @@ static int tegra_xudc_powerdomain_init(struct tegra_xudc *xudc) int err; xudc->genpd_dev_device = dev_pm_domain_attach_by_name(dev, "dev"); - if (IS_ERR(xudc->genpd_dev_device)) { - err = PTR_ERR(xudc->genpd_dev_device); + if (IS_ERR_OR_NULL(xudc->genpd_dev_device)) { + err = PTR_ERR(xudc->genpd_dev_device) ? : -ENODATA; dev_err(dev, "failed to get device power domain: %d\n", err); return err; } xudc->genpd_dev_ss = dev_pm_domain_attach_by_name(dev, "ss"); - if (IS_ERR(xudc->genpd_dev_ss)) { - err = PTR_ERR(xudc->genpd_dev_ss); + if (IS_ERR_OR_NULL(xudc->genpd_dev_ss)) { + err = PTR_ERR(xudc->genpd_dev_ss) ? : -ENODATA; dev_err(dev, "failed to get SuperSpeed power domain: %d\n", err); return err; } -- 2.35.1