mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] rbd: Fix uninitialized variable use in rbd_acquire_lock
@ 2017-07-13  7:46 Kefeng Wang
  2017-07-14 10:06 ` Ilya Dryomov
  0 siblings, 1 reply; 4+ messages in thread
From: Kefeng Wang @ 2017-07-13  7:46 UTC (permalink / raw)
  To: Ilya Dryomov, Sage Weil, Alex Elder, Mike Christie
  Cc: linux-kernel, Kefeng Wang

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 <wangkefeng.wang@huawei.com>
---
 drivers/block/rbd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b008b6a..b640ad8 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3435,7 +3435,7 @@ static void rbd_acquire_lock(struct work_struct *work)
 	struct rbd_device *rbd_dev = container_of(to_delayed_work(work),
 					    struct rbd_device, lock_dwork);
 	enum rbd_lock_state lock_state;
-	int ret;
+	int ret = 0;
 
 	dout("%s rbd_dev %p\n", __func__, rbd_dev);
 again:
-- 
1.7.12.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-17 15:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-13  7:46 [PATCH] rbd: Fix uninitialized variable use in rbd_acquire_lock Kefeng Wang
2017-07-14 10:06 ` Ilya Dryomov
2017-07-14 11:25   ` Kefeng Wang
2017-07-17 15:08     ` Ilya Dryomov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®