Skip to content
Commit a8c99596 authored by Jacob Keller's avatar Jacob Keller Committed by Greg Kroah-Hartman
Browse files

e100: fix length calculation in e100_get_regs_len

[ Upstream commit 4329c8dc ]

commit abf9b902 ("e100: cleanup unneeded math") tried to simplify
e100_get_regs_len and remove a double 'divide and then multiply'
calculation that the e100_reg_regs_len function did.

This change broke the size calculation entirely as it failed to account
for the fact that the numbered registers are actually 4 bytes wide and
not 1 byte. This resulted in a significant under allocation of the
register buffer used by e100_get_regs.

Fix this by properly multiplying the register count by u32 first before
adding the size of the dump buffer.

Fixes: abf9b902

 ("e100: cleanup unneeded math")
Reported-by: default avatarFelicitas Hetzelt <felicitashetzelt@gmail.com>
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6378e8a5
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment