OSDN Git Service

mmc: block: blk-mq: Potential NULL deref on mmc_blk_alloc_req() failure
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 Dec 2017 11:55:16 +0000 (14:55 +0300)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 11 Dec 2017 12:13:38 +0000 (13:13 +0100)
commit2361bfb055f948eac6583fa3c75a014da84fe554
tree861cae40e0a7e64d1bfbc79ad55d643283340cac
parent0562315b86372d2cdd9cc8924b92cfab37049fbc
mmc: block: blk-mq: Potential NULL deref on mmc_blk_alloc_req() failure

mmc_blk_alloc_req() is supposed to return error pointers but there is
one path where we forget to set the error code and accidentally return
NULL.  The callers are not expecting that and will have a NULL pointer
dereference.

Fixes: 41e3efd07d5a ("mmc: block: Simplify cleaning up the queue")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/block.c