[dm-devel] [PATCH] dm-writecache: fix a warning about uninitialized variable

Mikulas Patocka mpatocka at redhat.com
Wed Oct 2 11:07:57 UTC 2019


This fixes coverity warning CID 1454301.

Signed-off-by: Mikulas Patocka <mpatocka at redhat.com>

---
 drivers/md/dm-writecache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6/drivers/md/dm-writecache.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-writecache.c	2019-10-01 13:14:44.000000000 +0200
+++ linux-2.6/drivers/md/dm-writecache.c	2019-10-01 16:19:40.000000000 +0200
@@ -1561,7 +1561,7 @@ static void writecache_writeback(struct
 {
 	struct dm_writecache *wc = container_of(work, struct dm_writecache, writeback_work);
 	struct blk_plug plug;
-	struct wc_entry *f, *g, *e = NULL;
+	struct wc_entry *f, *uninitialized_var(g), *e = NULL;
 	struct rb_node *node, *next_node;
 	struct list_head skipped;
 	struct writeback_list wbl;




More information about the dm-devel mailing list