Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ublk: remove unnecessary checks in ublk_check_and_get_req()

ub = iocb->ki_filp->private_data cannot be NULL, as it's set in
ublk_ch_open() before it returns succesfully. req->mq_hctx cannot be
NULL as any inflight ublk request must belong to some queue. And
req->mq_hctx->driver_data cannot be NULL as it's set to the ublk_queue
pointer in ublk_init_hctx(). So drop the unnecessary checks.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Caleb Sander Mateos and committed by
Jens Axboe
6b0a2993 86afb1cd

-6
-6
drivers/block/ublk_drv.c
··· 2508 2508 size_t buf_off; 2509 2509 u16 tag, q_id; 2510 2510 2511 - if (!ub) 2512 - return ERR_PTR(-EACCES); 2513 - 2514 2511 if (!user_backed_iter(iter)) 2515 2512 return ERR_PTR(-EACCES); 2516 2513 ··· 2532 2535 req = __ublk_check_and_get_req(ub, q_id, tag, *io, buf_off); 2533 2536 if (!req) 2534 2537 return ERR_PTR(-EINVAL); 2535 - 2536 - if (!req->mq_hctx || !req->mq_hctx->driver_data) 2537 - goto fail; 2538 2538 2539 2539 if (!ublk_check_ubuf_dir(req, dir)) 2540 2540 goto fail;