linux/drivers/mmc
Shawn Lin 923dff8737 mmc: sdio: deploy error handling instead of triggering BUG_ON
When using mmc_io_rw_extended, it's intent to avoid null
pointer of card and invalid func number. But actually it
didn't prevent that as the seg_size already use the card.
Currently the wrapper function sdio_io_rw_ext_helper already
use card before calling mmc_io_rw_extended, so we should move
this check to there. As to the func number, it was token from
'(ocr & 0x70000000) >> 28' which should be enough to guarantee
that it won't be larger than 7. But we should prevent the
caller like wifi drivers modify this value. So let's move this
check into sdio_io_rw_ext_helper either.

Also we remove the BUG_ON for mmc_send_io_op_cond since all
possible paths calling this function are protected by checking
the arguments in advance. After deploying these changes, we
could not see any panic within SDIO API even if func drivers
abuse the SDIO func APIs.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2016-09-26 21:31:15 +02:00
..
card mmc: block: remove the check of packed for packed request routine 2016-09-26 21:31:15 +02:00
core mmc: sdio: deploy error handling instead of triggering BUG_ON 2016-09-26 21:31:15 +02:00
host mmc: host: sh_mobile_sdhi: don't populate unneeded functions 2016-09-26 21:31:14 +02:00
Kconfig
Makefile mmc: sdhci-pci: add platform data 2012-01-11 23:58:47 -05:00