zhenwei pi 72775cad7f virtio-blk: fix implicit overflow on virtio_max_dma_size
[ Upstream commit fafb51a67fb883eb2dde352539df939a251851be ]

The following codes have an implicit conversion from size_t to u32:
(u32)max_size = (size_t)virtio_max_dma_size(vdev);

This may lead overflow, Ex (size_t)4G -> (u32)0. Once
virtio_max_dma_size() has a larger size than U32_MAX, use U32_MAX
instead.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Message-Id: <20230904061045.510460-1-pizhenwei@bytedance.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 16:56:20 +00:00
..
2021-06-30 12:21:16 -07:00
2023-03-17 08:48:51 +01:00
2023-06-14 11:12:59 +02:00
2021-09-03 22:14:40 -06:00
2023-06-14 11:12:59 +02:00
2021-08-02 13:37:27 -06:00
2021-06-11 11:53:02 -06:00
2021-06-30 12:21:16 -07:00