Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3260138rwb; Mon, 15 Aug 2022 22:34:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR58thU7kQOeL8ajsaq0kmMC4rQ9kand6WQh5JHd1eL6fDyf54NRFe58u1JVVPZz/5KPxHO6 X-Received: by 2002:a17:90a:e7cc:b0:1f7:26c9:ee9f with SMTP id kb12-20020a17090ae7cc00b001f726c9ee9fmr22318268pjb.75.1660628063211; Mon, 15 Aug 2022 22:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628063; cv=none; d=google.com; s=arc-20160816; b=KODMjYYsF/T3HRko+WBkZ+TnkmMqDw0l9LHNnlyEg3x4TGptQlAUEL/m5hJZHC3eq4 s5o/MlsPy+wN9sMMcsd70KPtBJHx+swrqoJV766LN54no5+x0yEKHBduP6LIZlLxMKTy 84WQEi87j8RY88d6/E2R/TcRHPBLcsu0NdPIExoFt1oVkNdMhbd7ugxdjMrYj7e45KXQ R1+iBGU3/zHoySjghfQfOkDk2W043vJ3i6AuB7+8Ft48AvSyDlVBYb1cKmSFXGoz1M9i 6y/NrT0LZyrheo8Lzkze1gqL3psZhx10f1xVT0jUzJn+fatQ2G6mLVU5ZvROJKGRijEB T//A== 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=3lpZo/BL5oR8+ge9dMR8SiL3YY7hdiW/D/hLHOBMuvg=; b=RA40r3VRqr4t814OLre48lCe2d5lrSVi1TyFZx5cuslkjc5XSay02NdoV4MfWI8eWB areFOOpSwU27oRBPk+2uKLXsB3f0ztKsgMp8n3B2CfraNdwlic+gFoy7iCa+6Fqm7iRu XVlcENM17XmZXPVuDijJrr4m46cSwTW60welo7k3K0to97nhi1nyxm8bVM2ptSV+1A70 NcNUfDEriciqxsP72ymj7iW8FBgnmiJZJmk+F+P31vjxQgCXujvvEw2rBMJHO9Xdzh0F WeJqSLOivprZjKlPLmJgbVMX0i7IVtmrE1WttD6Imk/E969Gvcd1gBL6SOloTrQ9FI6S p7Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qRGbcqq4; 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 il16-20020a17090b165000b001f4c9f920f6si19547338pjb.157.2022.08.15.22.34.13; Mon, 15 Aug 2022 22:34:23 -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=qRGbcqq4; 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 S229912AbiHPEcW (ORCPT + 99 others); Tue, 16 Aug 2022 00:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229938AbiHPEcE (ORCPT ); Tue, 16 Aug 2022 00:32:04 -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 BDF3715E6A8; Mon, 15 Aug 2022 13:22:39 -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 ABD31CE1338; Mon, 15 Aug 2022 20:22:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C1BCC433D7; Mon, 15 Aug 2022 20:22:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594956; bh=upOuNVozmA5gKG06nV69IkF7pwwuDRy7qOL9pn71Rgw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qRGbcqq4ziIxy+9T0EoWnFaTsXtOSdoX2YGmpiXld1IyBb4bqT/JHvcyI6a7pdF/b U8JHoLanwBxnpWsPobZC3YCxqvT8sO4xRo9zLnC1ZmnND+9AWUZhOfa0PNjyvO4pVR vhYzsqq7GVsl+w32GbwL2ggy+Pn3HQPH4Bf9vjE0= 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 0611/1157] usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init() Date: Mon, 15 Aug 2022 19:59:27 +0200 Message-Id: <20220815180504.089683254@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 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 6d31ccf6aee5..3c37effdfa64 100644 --- a/drivers/usb/gadget/udc/tegra-xudc.c +++ b/drivers/usb/gadget/udc/tegra-xudc.c @@ -3691,15 +3691,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