mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 12:58:12 -04:00
ufs: sysfs: Use snprintf instead of sprintf
Replaces sprintf with snprintf for security. Change-Id: Ic9a140caabf6c3d4b13103214bfe41f336e2cf29 Signed-off-by: Asutosh Das <asutoshd@codeaurora.org>
This commit is contained in:
parent
19a5a7fa3b
commit
69ffb0e70b
1 changed files with 2 additions and 2 deletions
|
|
@ -643,7 +643,7 @@ static ssize_t _name##_show(struct device *dev, \
|
|||
pm_runtime_put_sync(hba->dev); \
|
||||
if (ret) \
|
||||
return -EINVAL; \
|
||||
return sprintf(buf, "%s\n", flag ? "true" : "false"); \
|
||||
return snprintf(buf, PAGE_SIZE, "%s\n", flag ? "true" : "false"); \
|
||||
} \
|
||||
static DEVICE_ATTR_RO(_name)
|
||||
|
||||
|
|
@ -696,7 +696,7 @@ static ssize_t _name##_show(struct device *dev, \
|
|||
pm_runtime_put_sync(hba->dev); \
|
||||
if (ret) \
|
||||
return -EINVAL; \
|
||||
return sprintf(buf, "0x%08X\n", value); \
|
||||
return snprintf(buf, PAGE_SIZE, "0x%08X\n", value); \
|
||||
} \
|
||||
static DEVICE_ATTR_RO(_name)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue