Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp632911iog; Mon, 13 Jun 2022 09:32:26 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u529EMWheiyj+dEYPStYiJfHWAnwwrke20Eme+rNx8miNq4XAXSmqhbSqvwJrRTTP6dfPl X-Received: by 2002:a17:902:d54a:b0:167:879c:abdf with SMTP id z10-20020a170902d54a00b00167879cabdfmr446293plf.73.1655137946196; Mon, 13 Jun 2022 09:32:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655137946; cv=none; d=google.com; s=arc-20160816; b=gFYpFmDbG1Vp8aNwzd9n2+D+kD1Y343Xat2IsbSko45xpKCDig52fDdYpa21Z3APL4 0f35SGDwIOrIWiku/FK97MCCp+FNDAWu830SGN1dJzSjVKxwE2bdI1/Mw4DROeiCBKPy v4i+4xTUummJSHGh9vJNL5QhxyQaY9C/TRp/E1cnZIEXWMZLm1joo1KpFVPqHzP42vlS lveYmIBIYz6hcSdCG/IJdAy/GSV/ueonwJSaRTtfvGvetetQjcoq5dLiH/5JikkoMFLQ jSjoRk4cfjmRtSeXodoVPZVi8j8qziKAGyn47FuxphWZBElkYiwgy1VyEzmbxx/kzrV+ AnEQ== 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=B3UkxcA6olZEFKWdg61JehfslL98d9Qdi2eaoyujLxw=; b=WmookZNM3Ue9BA11fQLVn4hnH1rmlxjI368F4JdllCO8HJZF/E+MQoaH9K9oh41/VC V9Lgk4Rn788LXBZYWazJwEJ7uGTvH7VaADeQAbd4LizSdiDVJNu8x30en6wBewaJIp9U dGY0urEgZKLMb8SKIjG/ilAQ9hE1af+n8sdIXhHrQ41EJ+EWb0CS28of57LSFtZyXpWQ vAbxVHjt0wX4HMThn7fM7bLAq+6Xkj27jXAgx7bsYIltxbHRr9ANOaaqY7nnhitp/veq Ap5P4eXlZ9fKbvoqfXDp5ft38d5FkAguTJvHIV3foAze5XWZpp7GEkmd46uZpxXHqeYh VGWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j2mYKcot; 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 t7-20020a634607000000b003fadcc14015si10106053pga.15.2022.06.13.09.32.13; Mon, 13 Jun 2022 09:32:26 -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=j2mYKcot; 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 S1353147AbiFMMNH (ORCPT + 99 others); Mon, 13 Jun 2022 08:13:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358838AbiFMMIp (ORCPT ); Mon, 13 Jun 2022 08:08:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AFED51E6C; Mon, 13 Jun 2022 04:00:17 -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 B4FCEB80E5E; Mon, 13 Jun 2022 11:00:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 16575C341C6; Mon, 13 Jun 2022 11:00:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655118014; bh=cpMk8xVrfIcPTt9lik83luCdwR0TAz+5Gcl5pjiojp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j2mYKcoth4nFKlFySVgAAwVsjfCjuJ9KjXClKHy7vGf6fIkNf3jjKxx21JCBqn86i bodRhb6KrTbWAwEldeIjI9oguUyk/CPU+H+8hP3Lxsdyn6mUkY7/ujUlx9uy8HpqR8 phD3MYOqJD03GYYrOO7l4OYOvkuqtghd+i9mS08A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zheng Yongjun , Sasha Levin Subject: [PATCH 4.19 198/287] usb: dwc3: pci: Fix pm_runtime_get_sync() error checking Date: Mon, 13 Jun 2022 12:10:22 +0200 Message-Id: <20220613094929.867058783@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094923.832156175@linuxfoundation.org> References: <20220613094923.832156175@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 ad2cb08b440f..527938eee846 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -205,7 +205,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