]> git.baikalelectronics.ru Git - kernel.git/commit
lightnvm: potential underflow in pblk_read_rq()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 21 Apr 2017 22:48:40 +0000 (16:48 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 21 Apr 2017 22:48:40 +0000 (16:48 -0600)
commit49af75bbede944202854cb3ed19fdc9b7ffa41fd
treed2d18834ddcd94e3d30a80aae4517b49aaf0ebad
parent5c5d603ddf31d87baf7eb813224923d9b4fd5aaa
lightnvm: potential underflow in pblk_read_rq()

This is a static checker fix, and perhaps not a real bug.  The static
checker thinks that nr_secs could be negative.  It would result in
zeroing more memory than intended.  Anyway, even if it's not a bug,
changing this variable to unsigned makes the code easier to audit.

Fixes: 666397e18deb ("lightnvm: physical block device (pblk) target")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/lightnvm/pblk-read.c