drm2(4): Fix double-free in low-memory error path
Reallocf frees 'block'; don't attempt to free it again. Reported by: Coverity CID: 1091165 Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
ccb64ff382
commit
0016129945
@ -353,8 +353,10 @@ drm_do_get_edid(struct drm_connector *connector, device_t adapter)
|
||||
|
||||
new = reallocf(block, (block[0x7e] + 1) * EDID_LENGTH, DRM_MEM_KMS,
|
||||
M_NOWAIT);
|
||||
if (!new)
|
||||
if (!new) {
|
||||
block = NULL;
|
||||
goto out;
|
||||
}
|
||||
block = new;
|
||||
|
||||
for (j = 1; j <= block[0x7e]; j++) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user