Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp445342iog; Mon, 13 Jun 2022 06:08:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHYbLCe6joEW7muJabV1Z5dy9/++/ul8Yd2tA3mIdRbOuWwEztPpXxEX2+tSL41MZAHcRy X-Received: by 2002:a17:906:414f:b0:711:ce99:69ec with SMTP id l15-20020a170906414f00b00711ce9969ecmr36035128ejk.724.1655125689835; Mon, 13 Jun 2022 06:08:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125689; cv=none; d=google.com; s=arc-20160816; b=ZM+0ngINSfeIMm3VbiLyJu5N+ryVch2Zj5O+pWg2aj9la8BQHL/Tw8XBgzGvgVjvVp 1Z56U1ODzBBQ0cDleLIqxDz7zLdpRYtu5B1EcRAyroIXx2zjMaI1rCvGUjpsmJYeMH6F 1jCxqRHkNs3J7Azg6w3aknOX+BoHslv4/ce1ABrDcBnBBzX7mdSX+xBI7dLWasp0vhyE E4IarDRzn2uAwPD+bJiaJSNbVd9LR7+PFs8DS5zPjaBnXd26MffhGCoeKCs5rMrFMcf2 1WQILqDG0+dYi6s1uTmOm4WyumNaUZtfuH4WYWVkawSWVN1DdijOfSr16/HKlbt7XT7y zyWA== 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=h4eMWwkn8WxUgTFN4tl2KdwNBtut0tlF2aRdBRHgTs8=; b=hdQs3Y35o6XoMfvHKh/P/lyg91Flmzya+FMblGm8ihX/KzUoRQXx2j4v3uQ9RnbL9f r1d10RtEjmqhWvPf0ETFJLEmjIT7yBOvMFpsH7tb8AXSQbW7f9x9a2APnli2B83P8MQm KjA5f36PhFVn/5o6eATLAFrafpXl/CJIOS0wdQ1xq3+RiqcdpKtCuEUeeh8ZE2ouO0lO +hVvswSlYT4YgLXpJlhN+/i++oMjHyhLRPSejtydcm2B8+yKbl6oiYHlsYvY1zqwI+2K 2jj5AWWz0DKQ6XAOSJiSVVmhxGzVmqtM6Th95HKib6tgxVgAvDejKIWkV5Yvbgo1fmLO 8+Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=t72lEPFG; 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 dz11-20020a0564021d4b00b0042fadee7b91si9245283edb.406.2022.06.13.06.07.43; Mon, 13 Jun 2022 06:08:09 -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=t72lEPFG; 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 S1355016AbiFMLhB (ORCPT + 99 others); Mon, 13 Jun 2022 07:37:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354664AbiFML3u (ORCPT ); Mon, 13 Jun 2022 07:29:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 558172AC76; Mon, 13 Jun 2022 03:45:22 -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 DD2D961252; Mon, 13 Jun 2022 10:45:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB392C34114; Mon, 13 Jun 2022 10:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117121; bh=OMj39jS06hxaG1nDHlRURp1yNmU2OPNlfpnor1SiATM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t72lEPFGCYilfLBZZ4NM6mefe/xaztGU1cCN9RNzmsfDCqn0HavrFuFvHo+Wn0KDl o0sLvE7u2+fSZN//JT+jeSAWX/BF63hfvm8AQApjcx52qIYVcgsCqnwWNPG/Hlw1jy p4MUm2nTOxj7CFvGJA1GMR6l9Kf7ZDO/QHcKDElQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheng Yongjun , Sasha Levin Subject: [PATCH 5.4 294/411] usb: dwc3: pci: Fix pm_runtime_get_sync() error checking Date: Mon, 13 Jun 2022 12:09:27 +0200 Message-Id: <20220613094937.574792706@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 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: Zheng Yongjun [ Upstream commit a03e2ddab8e735e2cc315609b297b300e9cc60d2 ] If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Fixes: 8eed00b237a28 ("usb: dwc3: pci: Runtime resume child device from wq") Signed-off-by: Zheng Yongjun Link: https://lore.kernel.org/r/20220422062652.10575-1-zhengyongjun3@huawei.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc3/dwc3-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 99964f96ff74..955bf820f410 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -211,7 +211,7 @@ static void dwc3_pci_resume_work(struct work_struct *work) int ret; ret = pm_runtime_get_sync(&dwc3->dev); - if (ret) { + if (ret < 0) { pm_runtime_put_sync_autosuspend(&dwc3->dev); return; } -- 2.35.1