diff options
author | Chao Jiang <chaoj@nvidia.com> | 2011-08-04 11:31:18 +0900 |
---|---|---|
committer | Niket Sirsi <nsirsi@nvidia.com> | 2011-08-17 15:57:43 -0700 |
commit | f537c37a7daa92e2a6da13e82513f114b0e9a2f7 (patch) | |
tree | 92903684b4e48af0d705eea4ef48b66ad5d05574 | |
parent | 9b66ffc8ab01b56753dac6c978c89ba2dbb8e09e (diff) |
ARM: Tegra: removed '\n' before counting fuse len
Removed '\n' character in the input buffer to get a correct length of
data.
fixed Bug856327
Change-Id: I1a15eafa8ba3e0cc1da7872c41abc5963685cdb1
Reviewed-on: http://git-master/r/46595
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Chao Jiang <chaoj@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/tegra2_fuse.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/tegra2_fuse.c b/arch/arm/mach-tegra/tegra2_fuse.c index b8fcd2371a5b..129004ba2d52 100644 --- a/arch/arm/mach-tegra/tegra2_fuse.c +++ b/arch/arm/mach-tegra/tegra2_fuse.c @@ -727,7 +727,9 @@ static ssize_t fuse_store(struct kobject *kobj, struct kobj_attribute *attr, return -EPERM; } - count--; + if (buf[count - 1] == '\n') + count--; + if (DIV_ROUND_UP(count, 2) > fuse_info_tbl[param].sz) { pr_err("%s: fuse parameter too long, should be %d character(s)\n", __func__, fuse_info_tbl[param].sz * 2); |