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 <[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]>
1 parent 1db8f5f commit bb47620

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)