Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 197ccdd9 authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by shaohanlin
Browse files

usb: gadget: core: unmap request from DMA only if previously mapped



In the SG case this is already handled since a non-zero
request->num_mapped_sgs is a clear indicator that dma_map_sg()
had been called. While it would be nice to do the same for the
singly mapped case by simply checking for non-zero request->dma,
it's conceivable that 0 is a valid dma_addr_t handle. Hence add
a flag 'dma_mapped' to struct usb_request and use this to
determine the need to call dma_unmap_single(). Otherwise, if a
request is not DMA mapped then the result of calling
usb_request_unmap_request() would safely be a no-op.

Change-Id: Ibb00d6df31f21522da9ebbcda3ae288cb7b189fa
Signed-off-by: default avatarJack Pham <jackp@codeaurora.org>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Git-commit: 31fe084ffaaf8abece14f8ca28e5e3b4e2bf97b6
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git


[cchiluve@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 5e847d08
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment