staging: mt7621-mmc: Only unmap_sg if mapped
authorGeorge Hilliard <thirtythreeforty@gmail.com>
Tue, 19 Mar 2019 02:20:12 +0000 (20:20 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Mar 2019 07:23:18 +0000 (08:23 +0100)
commitb8585eb51e74034a7c1dd534a667400b8fd58787
treec22f5d55a83064d23f87da68c152f9dbf9633476
parentb22f49923ac873beb77f1e1082022985054fb702
staging: mt7621-mmc: Only unmap_sg if mapped

A failure while processing the start command could cause dma_unmap_sg()
to be called without first calling dma_map_sg().

Since calling dma_unmap_sg() is only needed when data != NULL, move the
unmap call into the corresponding if {} block.

Signed-off-by: George Hilliard <thirtythreeforty@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/mt7621-mmc/sd.c