X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fchar%2Fselection.c;h=71093a9fc462ac8f562a8c8e980a7d7deceadd89;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=16d630f58bb491cbf5394960ef5a8e90f30f4b4f;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/char/selection.c b/drivers/char/selection.c index 16d630f58..71093a9fc 100644 --- a/drivers/char/selection.c +++ b/drivers/char/selection.c @@ -246,8 +246,7 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t clear_selection(); return -ENOMEM; } - if (sel_buffer) - kfree(sel_buffer); + kfree(sel_buffer); sel_buffer = bp; obp = bp; @@ -276,7 +275,8 @@ int set_selection(const struct tiocl_selection __user *sel, struct tty_struct *t int paste_selection(struct tty_struct *tty) { struct vc_data *vc = (struct vc_data *)tty->driver_data; - int pasted = 0, count; + int pasted = 0; + unsigned int count; struct tty_ldisc *ld; DECLARE_WAITQUEUE(wait, current); @@ -294,7 +294,7 @@ int paste_selection(struct tty_struct *tty) continue; } count = sel_buffer_lth - pasted; - count = min(count, tty->ldisc.receive_room(tty)); + count = min(count, tty->receive_room); tty->ldisc.receive_buf(tty, sel_buffer + pasted, NULL, count); pasted += count; }