]> git.baikalelectronics.ru Git - kernel.git/commit
amd-xgbe: Fix possible uninitialized variable
authorLendacky, Thomas <Thomas.Lendacky@amd.com>
Tue, 15 Nov 2016 22:11:05 +0000 (16:11 -0600)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 Nov 2016 18:57:44 +0000 (13:57 -0500)
commit9a892ae4a712b27e4adbd281f113c993578346cd
treeb3cae8ad309b4c7ba93cdfd48b2a7dcac512809a
parent0796029e0401a0e214d0e2e72e7fc5d667a7f083
amd-xgbe: Fix possible uninitialized variable

The debugfs support in the driver uses a common routine to write the
debugfs values. In this routine, if the input file position is non-zero
then the write routine will not return an error and an output parameter
will not have been set. Because an error isn't returned an uninitialized
value will be written into a register.

Fix the common write routine to return an error if the input file position
is non-zero, which will propagate back to the caller.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c