Skip to content

Commit

Permalink
tty: tty_io.c shadows sparse fix
Browse files Browse the repository at this point in the history
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: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jason Wessel authored and Linus Torvalds committed Oct 13, 2008
1 parent 8440838 commit 402fda9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/char/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,19 +1026,19 @@ static inline ssize_t do_tty_write(

/* write_buf/write_cnt is protected by the atomic_write_lock mutex */
if (tty->write_cnt < chunk) {
unsigned char *buf;
unsigned char *buf_chunk;

if (chunk < 1024)
chunk = 1024;

buf = kmalloc(chunk, GFP_KERNEL);
if (!buf) {
buf_chunk = kmalloc(chunk, GFP_KERNEL);
if (!buf_chunk) {
ret = -ENOMEM;
goto out;
}
kfree(tty->write_buf);
tty->write_cnt = chunk;
tty->write_buf = buf;
tty->write_buf = buf_chunk;
}

/* Do the write .. */
Expand Down

0 comments on commit 402fda9

Please sign in to comment.