projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4951cc9
)
virtio-rng: don't crash if virtqueue is broken.
author
Rusty Russell
<rusty@rustcorp.com.au>
Thu, 13 Mar 2014 00:53:40 +0000
(11:23 +1030)
committer
Rusty Russell
<rusty@rustcorp.com.au>
Thu, 13 Mar 2014 00:57:57 +0000
(11:27 +1030)
A bad implementation of virtio might cause us to mark the virtqueue
broken: we'll dev_err() in that case, and the device is useless, but
let's not BUG().
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/hw_random/virtio-rng.c
patch
|
blob
|
history
diff --git
a/drivers/char/hw_random/virtio-rng.c
b/drivers/char/hw_random/virtio-rng.c
index c12398d1517c5cb35711b9c1770d6a4b1eb2ca51..2ce0e225e58c3edbceeafa290c8db065eb4e6e72 100644
(file)
--- a/
drivers/char/hw_random/virtio-rng.c
+++ b/
drivers/char/hw_random/virtio-rng.c
@@
-47,8
+47,7
@@
static void register_buffer(u8 *buf, size_t size)
sg_init_one(&sg, buf, size);
/* There should always be room for one buffer. */
- if (virtqueue_add_inbuf(vq, &sg, 1, buf, GFP_KERNEL) < 0)
- BUG();
+ virtqueue_add_inbuf(vq, &sg, 1, buf, GFP_KERNEL);
virtqueue_kick(vq);
}