virtio: handle short buffers in virtio_rng.
authorRusty Russell <rusty@rustcorp.com.au>
Sat, 13 Jun 2009 04:16:39 +0000 (22:16 -0600)
committerRusty Russell <rusty@rustcorp.com.au>
Fri, 12 Jun 2009 12:46:40 +0000 (22:16 +0930)
commit594de1dd6449f79c99e1ba4577ea0e4e06e2b405
treeeeaa70736d1aa2b40433d5dc5c98195406591d85
parent98e94444748e9af93423d1fab90543e75569a58c
virtio: handle short buffers in virtio_rng.

If the device fills less than 4 bytes of our random buffer, we'll
BUG_ON.  It's nicer to handle the case where it partially fills the
buffer (the protocol doesn't explicitly bad that).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/hw_random/virtio-rng.c