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:
kaf24@firebug.cl.cam.ac.uk committed 2005-12-17 02:11:54 +01:00
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);
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.