Skip to content

Commit f28ad90

Browse files
Thinh Nguyengregkh
authored andcommitted
usb: dwc3: core: Fix tx/rx threshold settings
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: 938a5ad ("usb: dwc3: Check for ESS TX/RX threshold config") Cc: <[email protected]> Signed-off-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/cccfce990b11b730b0dae42f9d217dc6fb988c90.1649727139.git.Thinh.Nguyen@synopsys.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 456244a commit f28ad90

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/usb/dwc3/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,10 +1377,10 @@ static void dwc3_get_properties(struct dwc3 *dwc)
13771377
u8 lpm_nyet_threshold;
13781378
u8 tx_de_emphasis;
13791379
u8 hird_threshold;
1380-
u8 rx_thr_num_pkt_prd;
1381-
u8 rx_max_burst_prd;
1382-
u8 tx_thr_num_pkt_prd;
1383-
u8 tx_max_burst_prd;
1380+
u8 rx_thr_num_pkt_prd = 0;
1381+
u8 rx_max_burst_prd = 0;
1382+
u8 tx_thr_num_pkt_prd = 0;
1383+
u8 tx_max_burst_prd = 0;
13841384
u8 tx_fifo_resize_max_num;
13851385
const char *usb_psy_name;
13861386
int ret;

0 commit comments

Comments
 (0)