projects
/
profile
/
common
/
platform
/
kernel
/
u-boot-artik7.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
52afc9c
)
mmc: dw_mmc: nexell: use snprintf function
author
Chanho Park
<chanho61.park@samsung.com>
Wed, 10 Jan 2018 05:37:48 +0000
(14:37 +0900)
committer
Chanho Park
<chanho61.park@samsung.com>
Thu, 11 Jan 2018 12:13:37 +0000
(21:13 +0900)
This patch converts the sprintf function to the snprintf function to
detect buffer overflow.
Change-Id: Ic962a5f9e36cab11de83d4e1887bf74129358dd4
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
drivers/mmc/nexell_dw_mmc.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/nexell_dw_mmc.c
b/drivers/mmc/nexell_dw_mmc.c
index 546e7e79002782d6a7ebae28b50fa3e9a65c5fdf..703bbc0e55cbfe560c9882bbe62f6dc63a4c4c29 100644
(file)
--- a/
drivers/mmc/nexell_dw_mmc.c
+++ b/
drivers/mmc/nexell_dw_mmc.c
@@
-101,7
+101,7
@@
static unsigned int dw_mci_get_clk(struct dwmci_host *host, uint freq)
int index = host->dev_index;
char name[50] = {0, };
- s
printf(name
, "%s.%d", DEV_NAME_SDHC, index);
+ s
nprintf(name, sizeof(name)
, "%s.%d", DEV_NAME_SDHC, index);
clk = clk_get((const char *)name);
if (!clk)
return 0;
@@
-114,7
+114,7
@@
static unsigned long dw_mci_set_clk(int dev_index, unsigned rate)
struct clk *clk;
char name[50];
- s
printf(name
, "%s.%d", DEV_NAME_SDHC, dev_index);
+ s
nprintf(name, sizeof(name)
, "%s.%d", DEV_NAME_SDHC, dev_index);
clk = clk_get((const char *)name);
if (!clk)
return 0;