mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-03 03:16:43 +07:00
USB: EHCI: fix divide-by-zero bug
This patch (as1164) fixes a bug in the EHCI scheduler. The interval value it uses is already in linear format, not logarithmically coded. The existing code can sometimes crash the system by trying to divide by zero. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Cc: David Brownell <david-b@pacbell.net> Cc: Stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
67b2e02974
commit
372dd6e8ed
@ -918,7 +918,7 @@ iso_stream_init (
|
||||
*/
|
||||
stream->usecs = HS_USECS_ISO (maxp);
|
||||
bandwidth = stream->usecs * 8;
|
||||
bandwidth /= 1 << (interval - 1);
|
||||
bandwidth /= interval;
|
||||
|
||||
} else {
|
||||
u32 addr;
|
||||
@ -951,7 +951,7 @@ iso_stream_init (
|
||||
} else
|
||||
stream->raw_mask = smask_out [hs_transfers - 1];
|
||||
bandwidth = stream->usecs + stream->c_usecs;
|
||||
bandwidth /= 1 << (interval + 2);
|
||||
bandwidth /= interval << 3;
|
||||
|
||||
/* stream->splits gets created from raw_mask later */
|
||||
stream->address = cpu_to_hc32(ehci, addr);
|
||||
|
Loading…
Reference in New Issue
Block a user