summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
diff options
context:
space:
mode:
authorLendacky, Thomas <Thomas.Lendacky@amd.com>2014-07-02 13:04:28 -0500
committerDavid S. Miller <davem@davemloft.net>2014-07-07 21:38:06 -0700
commitf3f128d40c4cc263af8e30b009a3eb17655e912b (patch)
treea477da84355de899d9706d279bee0448532e8ff8 /drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
parentdb55b62cab8d458aba4e7a81dc4dd98b45c03d85 (diff)
downloadlinux-f3f128d40c4cc263af8e30b009a3eb17655e912b.tar.bz2
amd-xgbe: Fix debugfs compatibility change with kstrtouint
The initial change from sscanf to kstrtouint broke backward compatbility by using a base of "0" in the kstrtouint call. This allowed for entering decimal, hexadecimal or octal as input where previously the sscanf always interpreted the input as hexadecimal. Additionally, -EIO was returned on error prior to this change and now it is whatever the error value that is returned by kstrtouint. Change the base value of the kstrtouint from 0 to 16 and return -EIO on error. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Reported-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c')
-rw-r--r--drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
index 81198587a6c6..346592dca33c 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c
@@ -165,9 +165,9 @@ static ssize_t xgbe_common_write(const char __user *buffer, size_t count,
return len;
workarea[len] = '\0';
- ret = kstrtouint(workarea, 0, value);
+ ret = kstrtouint(workarea, 16, value);
if (ret)
- return ret;
+ return -EIO;
return len;
}