Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3023284rwb; Mon, 15 Aug 2022 16:20:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6YhvCfVjSJxYKulFe8cRBxmZrCE8rPo65FzZWNk4/DZpGpP2Y4VEnEy2zCm11+9dr2+9Jq X-Received: by 2002:a17:907:7290:b0:731:3c0a:97f8 with SMTP id dt16-20020a170907729000b007313c0a97f8mr11780302ejc.127.1660605651543; Mon, 15 Aug 2022 16:20:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605651; cv=none; d=google.com; s=arc-20160816; b=GzC+8PwZ3WXTi1LkqhbNygx2YB0L6qV54IDJnIFREf9SgEXNSeGj5WMaQoQPiw23Lg L93/iKQVYddZTJLabdZakWhRmZysS1U3BLGpexcKb4HN/rISHLDcE5odWV6mG1jOauUx uiNnvCe0LAggpEgPaDZXoJUNQ38kdOxQdREliKLiGc/vMzs4ZoHpDJyXzIfyxQi+K95F rzIeNDzq9ZMH1vplfdkBjlQOlm09zM6uSE9imZdfdU9o1RZb3Qel9S704U53gTBUxdoy EnSdMfWL1QtuMsYzKQ5MsgbgZyKM9j2Kt9pwzj1d7sEmINy3jk/uIxE5RzJz5Pp9qGra 7BLQ== 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=Wkv/fxwUwaPVspuVSWkkzQRCUGr2tVZ9Sn/ioG7vVLIVxv8rvcF39kli+McKfybbAP G3zQWDLLCLBpegWcLubUJajLZrtD6Y2o8OY238WWiwB537W4/9K2lxbE63tofiycM+3o 4atlbJqZN4BszPfEQTlZUjAnVCJPJls1j/LHhRz4eL8VtQEZrAZM4WmUSMv42I0JNwLp hqvB+HiOacR9zQaQBQTT+t0HNczLTPOOhW3IhoWV48915BQUHEgUDdoToKSzgcuZIEm4 OwnEiOc/JHo4OWayUKYn0DgNtF6z8+Ici7zRmsDz8pDA63v5we51nS6v95qVPrSyyeGk qJsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NHwasjgU; 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 z6-20020a05640235c600b0043bb87a322csi9643439edc.52.2022.08.15.16.20.26; Mon, 15 Aug 2022 16:20:51 -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=NHwasjgU; 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 S1348058AbiHOVcd (ORCPT + 99 others); Mon, 15 Aug 2022 17:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348500AbiHOV1r (ORCPT ); Mon, 15 Aug 2022 17:27:47 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56EB932EFD; Mon, 15 Aug 2022 12:23:40 -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 C9CEBB80FD3; Mon, 15 Aug 2022 19:23:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A66CC433D6; Mon, 15 Aug 2022 19:23:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591417; bh=2iiww0YZVx3IsAfXGgFTGknilWMD0Hkj0gj15HbjlMg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NHwasjgURY70yICkhNdDzhc3Www5Cj78gjnPagV9DotDsROf9kOiZLmjQdZHOeVvs wwNBb8EfVFUBpZiFwOFcHOEwnUFJZNXWlwtb82/ipFQxLdhp+c2dGGDCOTYj9DneJ6 P7jMVqtY7/D5Rmlz5/CE3ZQo30RpI2PY+R1iWRCY= 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.18 0572/1095] usb: xhci: tegra: Fix error check Date: Mon, 15 Aug 2022 19:59:31 +0200 Message-Id: <20220815180453.227559450@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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