|
@@ -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 .. */
|