mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-08 07:38:10 +00:00
virtio-rng: don't crash if virtqueue is broken.
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>
This commit is contained in:
parent
4951cc9083
commit
9914a76617
1 changed files with 1 additions and 2 deletions
|
@ -47,8 +47,7 @@ static void register_buffer(u8 *buf, size_t size)
|
||||||
sg_init_one(&sg, buf, size);
|
sg_init_one(&sg, buf, size);
|
||||||
|
|
||||||
/* There should always be room for one buffer. */
|
/* There should always be room for one buffer. */
|
||||||
if (virtqueue_add_inbuf(vq, &sg, 1, buf, GFP_KERNEL) < 0)
|
virtqueue_add_inbuf(vq, &sg, 1, buf, GFP_KERNEL);
|
||||||
BUG();
|
|
||||||
|
|
||||||
virtqueue_kick(vq);
|
virtqueue_kick(vq);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue