Commit 402fda92 authored by Jason Wessel's avatar Jason Wessel Committed by Linus Torvalds

tty: tty_io.c shadows sparse fix

drivers/char/tty_io.c:1413:17: warning: symbol 'buf' shadows an earlier one
drivers/char/tty_io.c:1379:20: originally declared here
Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8440838b
...@@ -1026,19 +1026,19 @@ static inline ssize_t do_tty_write( ...@@ -1026,19 +1026,19 @@ static inline ssize_t do_tty_write(
/* write_buf/write_cnt is protected by the atomic_write_lock mutex */ /* write_buf/write_cnt is protected by the atomic_write_lock mutex */
if (tty->write_cnt < chunk) { if (tty->write_cnt < chunk) {
unsigned char *buf; unsigned char *buf_chunk;
if (chunk < 1024) if (chunk < 1024)
chunk = 1024; chunk = 1024;
buf = kmalloc(chunk, GFP_KERNEL); buf_chunk = kmalloc(chunk, GFP_KERNEL);
if (!buf) { if (!buf_chunk) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
kfree(tty->write_buf); kfree(tty->write_buf);
tty->write_cnt = chunk; tty->write_cnt = chunk;
tty->write_buf = buf; tty->write_buf = buf_chunk;
} }
/* Do the write .. */ /* Do the write .. */
......
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