Geert Uytterhoeven 7432b49b54 mmc: block: Initialize ret in mmc_blk_issue_drv_op() for MMC_DRV_OP_IOCTL
With gcc 4.1.2:

    drivers/mmc/core/block.c: In function ‘mmc_blk_issue_drv_op’:
    drivers/mmc/core/block.c:1178: warning: ‘ret’ may be used uninitialized in this function

Indeed, for MMC_DRV_OP_IOCTL, if mq_rq->ioc_count is zero, an
uninitialized value will be stored in mq_rq->drv_op_result and passed to
blk_end_request_all().

Can mq_rq->ioc_count be zero?
  - mmc_blk_ioctl_cmd() sets ioc_count to 1, so this is safe,
  - mmc_blk_ioctl_multi_cmd() obtains ioc_count from user space in
    response to the MMC_IOC_MULTI_CMD ioctl, and does allow zero.

Initialize ret to zero to fix this for current and future callers.

Fixes: 0493f6fe5bdee8ac ("mmc: block: Move boot partition locking into a driver op")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2017-07-11 16:27:44 +02:00
..
2017-07-10 16:32:34 -07:00
2017-07-09 18:48:37 -07:00
2017-07-04 14:37:25 -07:00
2017-07-04 14:47:47 -07:00
2017-07-07 13:55:45 -07:00
2017-07-08 12:36:50 -07:00
2017-07-09 18:48:37 -07:00
2017-07-04 14:28:22 -07:00
2017-07-06 12:10:33 -07:00
2017-07-03 20:55:59 -07:00
2017-07-03 20:55:59 -07:00
2017-07-04 11:48:27 -07:00
2017-07-05 17:09:27 -07:00
2017-07-06 11:32:40 -07:00
2017-07-09 18:48:37 -07:00
2017-07-04 14:47:47 -07:00
2017-07-07 13:55:45 -07:00
2017-07-08 15:51:57 -07:00
2017-07-01 14:30:39 -07:00
2017-07-07 09:44:06 -07:00
2017-07-08 15:51:57 -07:00
2017-07-05 21:46:42 +02:00
2017-07-08 15:51:57 -07:00
2017-07-05 17:09:27 -07:00
2017-07-04 14:47:47 -07:00
2017-07-06 15:38:31 -07:00
2017-07-07 09:44:06 -07:00
2017-07-06 12:10:33 -07:00
2017-07-04 14:47:47 -07:00
2017-07-07 13:42:04 -07:00
2017-07-03 20:27:48 -07:00
2017-07-09 18:48:37 -07:00