device_tree: fix compiler warnings (clang 5)

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>
This commit is contained in:
Philippe Mathieu-Daudé 2017-04-07 19:20:14 -03:00 committed by Michael Tokarev
parent 6b1de1484e
commit 21a9ad2f15

View 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) {