OSDN Git Service

staging: mt7621-mmc: Check for nonzero number of scatterlist entries
authorGeorge Hilliard <thirtythreeforty@gmail.com>
Wed, 20 Mar 2019 22:42:05 +0000 (16:42 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 22 Mar 2019 14:20:27 +0000 (15:20 +0100)
commitd4223e06b6aed581625f574ad8faa71b6c0fc903
tree9aca063aaf039002068227fad2d08ba1a024c363
parentf2778bb3cb6c7544578c45688f3d5bcb09e0ac87
staging: mt7621-mmc: Check for nonzero number of scatterlist entries

The buffer descriptor setup loop is correct only if it is setting up at
least one bd struct.  Besides, there is an error if dma_map_sg() returns
0, which is possible and must be handled.

Additionally, remove the BUG_ON() checking sglen, which is unnecessary
because we configure DMA with that constraint during init.

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