Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9914a766 authored by Rusty Russell's avatar Rusty Russell
Browse files

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: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 4951cc90
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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);
}