Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / drivers / lguest / lguest_device.c
index d81170a..89088d6 100644 (file)
@@ -126,7 +126,7 @@ static void status_notify(struct virtio_device *vdev)
  * sorted out, this routine is called so we can tell the Host which features we
  * understand and accept.
  */
-static void lg_finalize_features(struct virtio_device *vdev)
+static int lg_finalize_features(struct virtio_device *vdev)
 {
        unsigned int i, bits;
        struct lguest_device_desc *desc = to_lgdev(vdev)->desc;
@@ -136,6 +136,9 @@ static void lg_finalize_features(struct virtio_device *vdev)
        /* Give virtio_ring a chance to accept features. */
        vring_transport_features(vdev);
 
+       /* Make sure we don't have any features > 32 bits! */
+       BUG_ON((u32)vdev->features != vdev->features);
+
        /*
         * Since lguest is currently x86-only, we're little-endian.  That
         * means we could just memcpy.  But it's not time critical, and in
@@ -150,6 +153,8 @@ static void lg_finalize_features(struct virtio_device *vdev)
 
        /* Tell Host we've finished with this device's feature negotiation */
        status_notify(vdev);
+
+       return 0;
 }
 
 /* Once they've found a field, getting a copy of it is easy. */