mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
Small fix to the error-return path after calling
__copy_to_user in the swiotlb sync function. We cannot immediately exit the sync function as there may be tail work to do (e.g., kunmap_atomic). In fact, doing nothing is the right thing to do and is sufficient to avoid compiler warnings about not checking the __copy_to_user return value. Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
1 parent
97c947f209
commit
2cafb4b4e9
1 file changed
+2
-2
@@ -223,7 +223,7 @@ __sync_single(struct phys_addr buffer, char *dma_addr, size_t size, int dir)
|
||||
host = kmp + buffer.offset;
|
||||
if (dir == DMA_FROM_DEVICE) {
|
||||
if (__copy_to_user(host, dev, bytes))
|
||||
return; /* inaccessible */
|
||||
/* inaccessible */;
|
||||
} else
|
||||
memcpy(dev, host, bytes);
|
||||
kunmap_atomic(kmp, KM_SWIOTLB);
|
||||
@@ -236,7 +236,7 @@ __sync_single(struct phys_addr buffer, char *dma_addr, size_t size, int dir)
|
||||
page_to_pseudophys(buffer.page)) + buffer.offset;
|
||||
if (dir == DMA_FROM_DEVICE) {
|
||||
if (__copy_to_user(host, dma_addr, size))
|
||||
return; /* inaccessible */
|
||||
/* inaccessible */;
|
||||
} else if (dir == DMA_TO_DEVICE)
|
||||
memcpy(dma_addr, host, size);
|
||||
}
|
||||
|
||||