]> Git Repo - J-linux.git/commitdiff
vdpa: Consider device id larger than 31
authorParav Pandit <[email protected]>
Tue, 30 Nov 2021 04:29:49 +0000 (06:29 +0200)
committerMichael S. Tsirkin <[email protected]>
Wed, 8 Dec 2021 20:41:50 +0000 (15:41 -0500)
virtio device id value can be more than 31. Hence, use BIT_ULL in
assignment.

Fixes: 33b347503f01 ("vdpa: Define vdpa mgmt device, ops and a netlink interface")
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Parav Pandit <[email protected]>
Acked-by: Jason Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Michael S. Tsirkin <[email protected]>
drivers/vdpa/vdpa.c

index 7332a74a4b00c504014eb1d39b4873017dcab1a3..09bbe53c3ac4ec193717af888f58a0ba1347e636 100644 (file)
@@ -404,7 +404,8 @@ static int vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *m
                goto msg_err;
 
        while (mdev->id_table[i].device) {
-               supported_classes |= BIT(mdev->id_table[i].device);
+               if (mdev->id_table[i].device <= 63)
+                       supported_classes |= BIT_ULL(mdev->id_table[i].device);
                i++;
        }
 
This page took 0.054793 seconds and 4 git commands to generate.