diff options
author | Guoqing Jiang | 2023-05-24 15:00:22 +0800 |
---|---|---|
committer | Jens Axboe | 2023-06-11 19:48:42 -0600 |
commit | ba2eed1cf8f08f1e5b1ba009ac22554f14d05342 (patch) | |
tree | 2e542af5ff9d087b9cd616740b5a068e1e9afa5c /drivers | |
parent | d6e94913cb1cb4b4d1d737f72b5cef10b13395ff (diff) |
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: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20230524070026.2932-5-guoqing.jiang@linux.dev
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/rnbd/rnbd-srv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c index 1eb3aecea69e..f610dfca1ebc 100644 --- a/drivers/block/rnbd/rnbd-srv.c +++ b/drivers/block/rnbd/rnbd-srv.c @@ -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); rcu_read_unlock(); - if (!sess_dev || !ret) + if (!ret) return ERR_PTR(-ENXIO); return sess_dev; |