Commit 35d50e60 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by James Morris

tomoyo: fix sparse warning

Fix sparse warning.

$ make C=2 SUBDIRS=security/tomoyo CF="-D__cold__="
 CHECK   security/tomoyo/common.c
 CHECK   security/tomoyo/realpath.c
 CHECK   security/tomoyo/tomoyo.c
security/tomoyo/tomoyo.c:110:8: warning: symbol 'buf' shadows an earlier one
security/tomoyo/tomoyo.c:100:7: originally declared here
Signed-off-by: default avatarKentaro Takeda <takedakn@nttdata.co.jp>
Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarToshiharu Harada <haradats@nttdata.co.jp>
Signed-off-by: default avatarJames Morris <jmorris@namei.org>
parent 42d5aaa2
...@@ -107,13 +107,13 @@ static char *tomoyo_sysctl_path(struct ctl_table *table) ...@@ -107,13 +107,13 @@ static char *tomoyo_sysctl_path(struct ctl_table *table)
*--end = '\0'; *--end = '\0';
buflen--; buflen--;
while (table) { while (table) {
char buf[32]; char num[32];
const char *sp = table->procname; const char *sp = table->procname;
if (!sp) { if (!sp) {
memset(buf, 0, sizeof(buf)); memset(num, 0, sizeof(num));
snprintf(buf, sizeof(buf) - 1, "=%d=", table->ctl_name); snprintf(num, sizeof(num) - 1, "=%d=", table->ctl_name);
sp = buf; sp = num;
} }
if (tomoyo_prepend(&end, &buflen, sp) || if (tomoyo_prepend(&end, &buflen, sp) ||
tomoyo_prepend(&end, &buflen, "/")) tomoyo_prepend(&end, &buflen, "/"))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment