Skip to content
Commit e24721e4 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

ublk: fix 'warn: variable dereferenced before check 'req'' from Smatch



The added check of 'req_op(req) == REQ_OP_ZONE_APPEND' should have been
done after the request is confirmed as valid.

Actually here, the request should always been true, so add one
WARN_ON_ONCE(!req), meantime move the zone_append check after
checking the request.

Cc: Andreas Hindborg <a.hindborg@samsung.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Fixes: 29802d7c ("ublk: enable zoned storage support")
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230811135216.420404-1-ming.lei@redhat.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 18267a03
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment