From: Lendacky, Thomas Date: Wed, 2 Jul 2014 18:04:28 +0000 (-0500) Subject: amd-xgbe: Fix debugfs compatibility change with kstrtouint X-Git-Tag: v3.17-rc1~106^2~216^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3f128d40c4cc263af8e30b009a3eb17655e912b;p=platform%2Fkernel%2Flinux-exynos.git 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 Reported-by: Joe Perches Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c b/drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c index 8119858..346592d 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; }