Commit ba2eed1c authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Jens Axboe

block/rnbd-srv: no need to check sess_dev

Check ret is enough since if sess_dev is NULL which also
implies ret should be 0.
Acked-by: default avatarJack Wang <jinpu.wang@ionos.com>
Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20230524070026.2932-5-guoqing.jiang@linux.devSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent d6e94913
...@@ -96,7 +96,7 @@ rnbd_get_sess_dev(int dev_id, struct rnbd_srv_session *srv_sess) ...@@ -96,7 +96,7 @@ rnbd_get_sess_dev(int dev_id, struct rnbd_srv_session *srv_sess)
ret = kref_get_unless_zero(&sess_dev->kref); ret = kref_get_unless_zero(&sess_dev->kref);
rcu_read_unlock(); rcu_read_unlock();
if (!sess_dev || !ret) if (!ret)
return ERR_PTR(-ENXIO); return ERR_PTR(-ENXIO);
return sess_dev; return sess_dev;
......
Markdown is supported
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