mmc: fix use-after-free of struct request
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 25 Aug 2016 20:11:43 +0000 (14:11 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 25 Aug 2016 20:11:43 +0000 (14:11 -0600)
commit869c554808ccf7ddd25be5317073b88ceddb8507
treeed7f5a2112a7d00dbfa02415585bc7d1991fe824
parentf2791e7eadf437633f30faa51b30878cf15650be
mmc: fix use-after-free of struct request

We call mmc_req_is_special() after having processed a request, but
it could be freed after that. Check that ahead of time, and use
the cached value.

Reported-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Fixes: c2df40dfb8c0 ("drivers: use req op accessor")
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/mmc/card/block.c
drivers/mmc/card/queue.c