xf86drm: Fix segmentation fault while parsing device info
This fixes a bug, which was introduced with commitmainee798b98
"xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus,Device}Info". where accessing *compatible[i] with i>0 results in a segfault. Signed-off-by: Andreas Baierl <ichgeh@imkreisrum.de> Fixes:ee798b9847
"xf85drm: de-duplicate drmParse{Platform.Host1x}{Bus,Device}Info" Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> [Eric: add the same fix to the free() below] Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
parent
0b032a645e
commit
4735ca71af
|
@ -3629,14 +3629,14 @@ static int drmParseOFDeviceInfo(int maj, int min, char ***compatible)
|
||||||
free(value);
|
free(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
*compatible[i] = tmp_name;
|
(*compatible)[i] = tmp_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
free:
|
free:
|
||||||
while (i--)
|
while (i--)
|
||||||
free(*compatible[i]);
|
free((*compatible)[i]);
|
||||||
|
|
||||||
free(*compatible);
|
free(*compatible);
|
||||||
return err;
|
return err;
|
||||||
|
|
Loading…
Reference in New Issue