Skip to content

Commit 519dae9

Browse files
committed
Smbios: don't try to scan memory multiple times
1 parent 34419d9 commit 519dae9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util/smbiosHelper.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ const FFSmbiosHeaderTable* ffGetSmbiosHeaderTable()
138138

139139
if (buffer.chars == NULL)
140140
{
141+
ffStrbufInit(&buffer);
141142
#ifndef __HAIKU__
142143
#ifdef __linux__
143144
if (!ffAppendFileBuffer("/sys/firmware/dmi/tables/DMI", &buffer))
@@ -289,6 +290,9 @@ const FFSmbiosHeaderTable* ffGetSmbiosHeaderTable()
289290
}
290291
}
291292

293+
if (buffer.length == 0)
294+
return NULL;
295+
292296
return &table;
293297
}
294298
#elif defined(_WIN32)

0 commit comments

Comments
 (0)