diff options
author | Shaohua Li <shli@fb.com> | 2017-08-25 13:46:25 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2017-08-25 14:52:01 -0600 |
commit | 0d06a42f794bec6061e170fa9468d878051bc8b1 (patch) | |
tree | 5392f11e483ace79a5378c01670df2fb90c10c9c /drivers/block/skd_main.c | |
parent | 4c18c9e962eb02e23731e5b40d4474fb04fdcb23 (diff) | |
download | linux-0d06a42f794bec6061e170fa9468d878051bc8b1.tar.gz linux-0d06a42f794bec6061e170fa9468d878051bc8b1.tar.bz2 linux-0d06a42f794bec6061e170fa9468d878051bc8b1.zip |
block/nullb: fix NULL dereference
Dan reported this:
The patch 2984c8684f96: "nullb: factor disk parameters" from Aug 14,
2017, leads to the following Smatch complaint:
drivers/block/null_blk.c:1759 null_init_tag_set()
error: we previously assumed 'nullb' could be null (see line
1750)
1755 set->cmd_size = sizeof(struct nullb_cmd);
1756 set->flags = BLK_MQ_F_SHOULD_MERGE;
1757 set->driver_data = NULL;
1758
1759 if (nullb->dev->blocking)
^^^^^^^^^^^^^^^^^^^^
And an unchecked dereference.
nullb could be NULL here.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/skd_main.c')
0 files changed, 0 insertions, 0 deletions