mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 06:30:11 +01:00
intel/tools: handle some failures
Addresses "Dereference null return value" issues reported by Coverity. Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7449>
This commit is contained in:
parent
cd9907e7d3
commit
f0061277c0
1 changed files with 6 additions and 1 deletions
|
|
@ -446,7 +446,12 @@ maybe_init(int fd)
|
|||
|
||||
initialized = true;
|
||||
|
||||
config = fopen(getenv("INTEL_DUMP_GPU_CONFIG"), "r");
|
||||
const char *config_path = getenv("INTEL_DUMP_GPU_CONFIG");
|
||||
fail_if(config_path == NULL, "INTEL_DUMP_GPU_CONFIG is not set\n");
|
||||
|
||||
config = fopen(config_path, "r");
|
||||
fail_if(config == NULL, "failed to open file %s\n", config_path);
|
||||
|
||||
while (fscanf(config, "%m[^=]=%m[^\n]\n", &key, &value) != EOF) {
|
||||
if (!strcmp(key, "verbose")) {
|
||||
if (!strcmp(value, "1")) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue