]> git.baikalelectronics.ru Git - kernel.git/commit
block: mtip32xx: set error code on failure
authorPan Bian <bianpan2016@163.com>
Thu, 1 Dec 2016 02:10:46 +0000 (10:10 +0800)
committerJens Axboe <axboe@fb.com>
Thu, 1 Dec 2016 15:01:14 +0000 (08:01 -0700)
commit47a55e5074f2c0bd35110a0271fa04f37958ea0c
tree6ed363eecdcb05bdb2eb793a71f8c4bc34ee23c6
parentd93663f724c86e2905affa8a727e4fea954e2ebe
block: mtip32xx: set error code on failure

Fix bug https://bugzilla.kernel.org/show_bug.cgi?id=188531. In function
mtip_block_initialize(), variable rv takes the return value, and its
value should be negative on errors. rv is initialized as 0 and is not
reset when the call to ida_pre_get() fails. So 0 may be returned.
The return value 0 indicates that there is no error, which may be
inconsistent with the execution status. This patch fixes the bug by
explicitly assigning -ENOMEM to rv on the branch that ida_pre_get()
fails.

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/mtip32xx/mtip32xx.c