mmc: card: fixing an false identification of SANITIZE command
authorYaniv Gardi <ygardi@codeaurora.org>
Wed, 5 Jun 2013 11:13:08 +0000 (14:13 +0300)
committerlintao <lintao@rock-chips.com>
Fri, 7 Mar 2014 11:50:37 +0000 (19:50 +0800)
commit3eb611d9d7f383ff5e8ba750846a680880ae714f
tree758953d883b469579f4a2e6d62ef3d65c9952474
parent4884e16cfc2566846e4759b905f966873c16ca2b
mmc: card: fixing an false identification of SANITIZE command

Inside the routine mmc_blk_ioctl_cmd() the sanitize command is
identified according to the value of bits 16-23 of the argument.

but what happens if a different command is sent, and only by
chance, bits 16-23 contain the value of SANITIZE command ?
In that case a SANITIZE command will be falsely identified.
In order to prevent such a case, the condition is expanded and
now it also checks the opcode itself, and verifies that it is an
MMC_SWITCH opcode.

Signed-off-by: Yaniv Gardi <ygardi@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/card/block.c