OSDN Git Service

vfio/type1: silence integer overflow warning
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Oct 2017 17:41:56 +0000 (11:41 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Fri, 20 Oct 2017 17:41:56 +0000 (11:41 -0600)
commit71a7d3d78e3ca51ea688ae88c389867d948377cd
tree74901aa0a48262807d8e409839a99f6f5a44455f
parent79d40370e8d31886a9413e2ee115fc426b4ae97e
vfio/type1: silence integer overflow warning

I get a static checker warning about the potential integer overflow if
we add "unmap->iova + unmap->size".  The integer overflow isn't really
harmful, but we may as well fix it.  Also unmap->size gets truncated to
size_t when we pass it to vfio_find_dma() so we could check for too high
values of that as well.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/vfio_iommu_type1.c