]> git.proxmox.com Git - mirror_qemu.git/commitdiff
device_tree: fix compiler warnings (clang 5)
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Fri, 7 Apr 2017 22:20:14 +0000 (19:20 -0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 7 May 2017 06:57:51 +0000 (09:57 +0300)
static code analyzer complain:

device_tree.c:155:18: warning: Null pointer passed as an argument to a 'nonnull' parameter
    while ((de = readdir(d)) != NULL) {
                 ^~~~~~~~~~

Reported-by: Clang Static Analyzer
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
device_tree.c

index 6e0632083094de0550643573527648422e9c24a4..a24ddff02bdd857cbbf50477879c07df19d89054 100644 (file)
@@ -148,6 +148,7 @@ static void read_fstree(void *fdt, const char *dirname)
     d = opendir(dirname);
     if (!d) {
         error_setg(&error_fatal, "%s cannot open %s", __func__, dirname);
+        return;
     }
 
     while ((de = readdir(d)) != NULL) {