mmc: dw_mmc: Handle return value from bounce_buffer_start()
authorMarek Vasut <marex@denx.de>
Sat, 23 Mar 2019 17:45:27 +0000 (18:45 +0100)
committerMarek Vasut <marex@denx.de>
Mon, 29 Apr 2019 08:08:56 +0000 (10:08 +0200)
commit6ad5aec419782955fa4be79c93f2640fc043f3cf
tree06bd32ad910f58b54952d788708958f6772e7bb6
parent4e16f0a67d80b4ce11995b870b5d9c8d11266d0d
mmc: dw_mmc: Handle return value from bounce_buffer_start()

The bounce_buffer_start() can return -ENOMEM in case memory allocation
failed. However, in that case, the bounce buffer address is the same as
the possibly unaligned input address, and the cache maintenance operations
were not applied to this address. This could cause subtle problems. Add
handling for the bounce_buffer_start() return value to prevent such a
problem from happening.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Simon Glass <sjg@chromium.org>
drivers/mmc/dw_mmc.c