Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4677910iob; Sun, 8 May 2022 21:40:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5hSNckaqGiK2Tp41q1ZEc5Bti95QqUvqldINRTUTcetEtsvUpXoXzbHXhOP7P1/h6izXh X-Received: by 2002:a05:6a00:2402:b0:4e1:3df2:5373 with SMTP id z2-20020a056a00240200b004e13df25373mr14426371pfh.40.1652071226404; Sun, 08 May 2022 21:40:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652071226; cv=none; d=google.com; s=arc-20160816; b=Qzr4K3PN0ljDEEvCuZ4rkwQj/fgdGpV7A8SX8mSlD48+Rs/3HOLfYyobYDFhd8ygXk kiVaQdW+NxYRz6mivNz3S/1Telcy0Yt7jlWGKggpXv8N4tFDzFSCsGnFqyLP/NYNiQwi RR4Vhqdhk6bgyIb3MwDeg4Gj5rR8TEGYkbE4jkD81jAANz4zCB1zeWxh/wMOVQUYzku7 tFPWNlmE5Y+XgJNjkr4xXgy2tLiBQbskRhIpvIbZIflMYJ6ROTxblT+3yqL5vXrtDoZk jJSCW2UXKSxEBX+CDXNjcYXTx74ehq0ma4YaIZp3t1ryAIn9LdbJBeZDfMFNL9H/cHv+ Fzkw== 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=527VuNIbET/vhB5784YbD7bJqbyxcMIDhgg33Pdzqss=; b=Rd1j0Sq7Fzoox3N/Bum4FwaqCl1hrDwQ120BeEJIwcxYK94RKcA5Rm0R49SSle0HAr kKlp3oW/W7EMVG8H2dnPwYpQUxsT7vSFhgLoq0wLyJUG5Alx0ZvKq5c2aFoEZCCED0xp vj2QcWWhtRfhCY5cq0MvYob68/4gJKBGjYsUJACp8tCv6NDG2r8Rb41tiI42BF6OOQfT 1ZG9+vvPX2UcncTOL/obqAnPjx9KnsYUEgmaXLiZhQKE8BnP1AP8jCrvwOZUSUl3Wjmn k8N+mRFl1NAIg0+/10LBgBQn0V25Zhdi/feaxhTkje06+PWEvST29IaoMNXk7OqiC75+ wuLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h0DSob0j; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id r10-20020a65508a000000b0039db9cfb7bdsi13414423pgp.735.2022.05.08.21.40.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 21:40:26 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=h0DSob0j; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4AF7712B004; Sun, 8 May 2022 21:40:13 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354770AbiEDRDu (ORCPT + 99 others); Wed, 4 May 2022 13:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354578AbiEDQ6x (ORCPT ); Wed, 4 May 2022 12:58:53 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41BBA18E23; Wed, 4 May 2022 09:50:35 -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 E911CB8279F; Wed, 4 May 2022 16:50:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D300C385AA; Wed, 4 May 2022 16:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1651683032; bh=VGWrJMBsSJWCvY6Eyia1YHHjBx1J6WcAmycKjTLapLU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h0DSob0j8pvFza690DqTFXDE5rt7XdGWt5O1SfzKIW/EK1V3Jz4lFcwd/T8uQ80Xl H2howAacZk7jrrON+owjGrPWaWujnU+4ktCxylG2vRgwDjGrXWOSTlwIgC+1tI1hM3 7geymiR0aZBHrRhoe2kYtX5wVvtE+xYls/B7HIpA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thinh Nguyen Subject: [PATCH 5.10 023/129] usb: dwc3: core: Fix tx/rx threshold settings Date: Wed, 4 May 2022 18:43:35 +0200 Message-Id: <20220504153023.099065718@linuxfoundation.org> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220504153021.299025455@linuxfoundation.org> References: <20220504153021.299025455@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=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Thinh Nguyen commit f28ad9069363dec7deb88032b70612755eed9ee6 upstream. The current driver logic checks against 0 to determine whether the periodic tx/rx threshold settings are set, but we may get bogus values from uninitialized variables if no device property is set. Properly default these variables to 0. Fixes: 938a5ad1d305 ("usb: dwc3: Check for ESS TX/RX threshold config") Cc: Signed-off-by: Thinh Nguyen Link: https://lore.kernel.org/r/cccfce990b11b730b0dae42f9d217dc6fb988c90.1649727139.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1277,10 +1277,10 @@ static void dwc3_get_properties(struct d u8 lpm_nyet_threshold; u8 tx_de_emphasis; u8 hird_threshold; - u8 rx_thr_num_pkt_prd; - u8 rx_max_burst_prd; - u8 tx_thr_num_pkt_prd; - u8 tx_max_burst_prd; + u8 rx_thr_num_pkt_prd = 0; + u8 rx_max_burst_prd = 0; + u8 tx_thr_num_pkt_prd = 0; + u8 tx_max_burst_prd = 0; /* default to highest possible threshold */ lpm_nyet_threshold = 0xf;