summaryrefslogtreecommitdiff
path: root/libkmod
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2015-01-25 23:54:05 -0200
committerLucas De Marchi <lucas.demarchi@intel.com>2015-01-25 23:54:05 -0200
commit01f9bc6deed3f9f14c8129efd0ffc100e7a0e6d0 (patch)
treee76bf1e65eca2c47a050c959615140a1e3248b41 /libkmod
parenta5f799af9819876c5d1dc9d77dc3ee9f12171b65 (diff)
downloadkmod-01f9bc6deed3f9f14c8129efd0ffc100e7a0e6d0.tar.gz
kmod-01f9bc6deed3f9f14c8129efd0ffc100e7a0e6d0.tar.bz2
kmod-01f9bc6deed3f9f14c8129efd0ffc100e7a0e6d0.zip
Fix uninitialized warning
Initialize variable to NULL before calling kmod_module_new_from_lookup(). libkmod/libkmod-module.c: In function 'kmod_module_new_from_lookup.part.4.constprop': libkmod/libkmod-module.c:192:8: warning: 'depmod' may be used uninitialized in this function [-Wmaybe-uninitialized] list = kmod_list_prepend(list, depmod); ^ libkmod/libkmod-module.c:173:23: note: 'depmod' was declared here struct kmod_module *depmod;
Diffstat (limited to 'libkmod')
-rw-r--r--libkmod/libkmod-module.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index 54bde73..30f15ca 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -170,7 +170,7 @@ int kmod_module_parse_depline(struct kmod_module *mod, char *line)
p++;
for (p = strtok_r(p, " \t", &saveptr); p != NULL;
p = strtok_r(NULL, " \t", &saveptr)) {
- struct kmod_module *depmod;
+ struct kmod_module *depmod = NULL;
const char *path;
path = path_join(p, dirnamelen, buf);