Skip to content

Commit bb47620

Browse files
paravmellanoxmstsirkin
authored andcommitted
vdpa: Consider device id larger than 31
virtio device id value can be more than 31. Hence, use BIT_ULL in assignment. Fixes: 33b3475 ("vdpa: Define vdpa mgmt device, ops and a netlink interface") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Parav Pandit <parav@nvidia.com> Acked-by: Jason Wang <jasowang@redhat.com> Link: https://lore.kernel.org/r/20211130042949.88958-1-parav@nvidia.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
1 parent 1db8f5f commit bb47620

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/vdpa/vdpa.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,8 @@ static int vdpa_mgmtdev_fill(const struct vdpa_mgmt_dev *mdev, struct sk_buff *m
404404
goto msg_err;
405405

406406
while (mdev->id_table[i].device) {
407-
supported_classes |= BIT(mdev->id_table[i].device);
407+
if (mdev->id_table[i].device <= 63)
408+
supported_classes |= BIT_ULL(mdev->id_table[i].device);
408409
i++;
409410
}
410411

0 commit comments

Comments
 (0)