Skip to content

Commit 37f1325

Browse files
Kefeng Wangidryomov
authored andcommitted
rbd: silence bogus uninitialized use warning in rbd_acquire_lock()
drivers/block/rbd.c: In function 'rbd_acquire_lock': drivers/block/rbd.c:3602:44: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized] Silence the warning, found it when built old kernel(3.10) with OBS(opensuse build service). Signed-off-by: Kefeng Wang <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 4214fb1 commit 37f1325

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3435,7 +3435,7 @@ static void rbd_acquire_lock(struct work_struct *work)
34353435
struct rbd_device *rbd_dev = container_of(to_delayed_work(work),
34363436
struct rbd_device, lock_dwork);
34373437
enum rbd_lock_state lock_state;
3438-
int ret;
3438+
int ret = 0;
34393439

34403440
dout("%s rbd_dev %p\n", __func__, rbd_dev);
34413441
again:

0 commit comments

Comments
 (0)