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:
parent
6b1de1484e
commit
21a9ad2f15
|
@ -148,6 +148,7 @@ static void read_fstree(void *fdt, const char *dirname)
|
||||||
d = opendir(dirname);
|
d = opendir(dirname);
|
||||||
if (!d) {
|
if (!d) {
|
||||||
error_setg(&error_fatal, "%s cannot open %s", __func__, dirname);
|
error_setg(&error_fatal, "%s cannot open %s", __func__, dirname);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((de = readdir(d)) != NULL) {
|
while ((de = readdir(d)) != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue