]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()
authorAlex Dewar <alex.dewar90@gmail.com>
Tue, 25 Aug 2020 09:19:28 +0000 (10:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 09:07:32 +0000 (10:07 +0100)
commit2e1356e81edd06e852efa08c222adb1a7476f73b
tree14dd9a785a8d9922e47a0e6ab75485baf215cc6d
parentad5c72b65770730783f12fcd9354cb842f61bfb3
staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()

[ Upstream commit cc34073c6248e9cec801bf690d1455f264d12357 ]

In nbu2ss_eq_queue() memory is allocated with dma_alloc_coherent(),
though, strangely, NULL is passed as the struct device* argument. Pass
the UDC's device instead. Fix up the corresponding call to
dma_free_coherent() in the same way.

Build-tested on x86 only.

Fixes: 33aa8d45a4fe ("staging: emxx_udc: Add Emma Mobile USB Gadget driver")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
Link: https://lore.kernel.org/r/20200825091928.55794-1-alex.dewar90@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/emxx_udc/emxx_udc.c