Skip to contentSkip to conversation

VFS: initlalise found in fs/block_dev.c:bd_claim_by_kobject()

PATCH New Simon Horman 1 participant 1 message Feb 14, 2007 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 VFS: initlalise found in fs/block_dev.c:bd_claim_by_kobject()

The patch below fixes the following warning, which by my reckoning is valid, though perhaps not something that happens in practice.

fs/block_dev.c: In function `bd_claim_by_disk':
fs/block_dev.c:953: warning: 'found' might be used uninitialized in this function

Patch is against the current Linus tree,
33e563c1190c26b6bf61990c505cdcb5cdbba7e4. 2.6.20+

fs/block_dev.c +1 -1
Index: linux-2.6/fs/block_dev.c
===================================================================
@@ -950,7 +950,7 @@
 				struct kobject *kobj)
 {
 	int res;
-	struct bd_holder *bo, *found;
+	struct bd_holder *bo, *found = NULL;
 
 	if (!kobj)
 		return -EINVAL;