mt76: mt7915: set fops_sta_stats.owner to THIS_MODULE
[platform/kernel/linux-starfive.git] / drivers / vhost / vringh.c
index e059a9a..8bd8b40 100644 (file)
@@ -284,13 +284,14 @@ __vringh_iov(struct vringh *vrh, u16 i,
        desc_max = vrh->vring.num;
        up_next = -1;
 
+       /* You must want something! */
+       if (WARN_ON(!riov && !wiov))
+               return -EINVAL;
+
        if (riov)
                riov->i = riov->used = 0;
-       else if (wiov)
+       if (wiov)
                wiov->i = wiov->used = 0;
-       else
-               /* You must want something! */
-               BUG();
 
        for (;;) {
                void *addr;