printk: fix failure to return error in devkmsg_poll()
authorNicolas Kaiser <nikai@nikai.net>
Mon, 29 Apr 2013 23:17:20 +0000 (16:17 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 30 Apr 2013 01:28:14 +0000 (18:28 -0700)
Error value got overwritten instantly.

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/printk.c

index 1c8ca176458f7ec3f4587ad8fc93f3b2c2804252..376914e2869d8a132456dc9216a77f11586dc9bd 100644 (file)
@@ -601,7 +601,8 @@ static unsigned int devkmsg_poll(struct file *file, poll_table *wait)
                /* return error when data has vanished underneath us */
                if (user->seq < log_first_seq)
                        ret = POLLIN|POLLRDNORM|POLLERR|POLLPRI;
-               ret = POLLIN|POLLRDNORM;
+               else
+                       ret = POLLIN|POLLRDNORM;
        }
        raw_spin_unlock_irq(&logbuf_lock);