summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/hctosys.c
diff options
context:
space:
mode:
authorShawn Lin <shawn.lin@rock-chips.com>2016-08-26 08:49:56 +0800
committerUlf Hansson <ulf.hansson@linaro.org>2016-09-26 21:31:15 +0200
commit923dff87373708801f501cbe8993df98a91b566e (patch)
treed25d01c5fa12812979ecfb35a6158b1617446e46 /drivers/rtc/hctosys.c
parent96e52daa508bf349582e41911da66461b54dcc12 (diff)
downloadlinux-923dff87373708801f501cbe8993df98a91b566e.tar.gz
linux-923dff87373708801f501cbe8993df98a91b566e.tar.bz2
linux-923dff87373708801f501cbe8993df98a91b566e.zip
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>
Diffstat (limited to 'drivers/rtc/hctosys.c')
0 files changed, 0 insertions, 0 deletions