If the second syscall fails (presumably as a deferred allocation failure
check), cleanup the allocations made so far before reporting the
failure.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
sna_output->prop_values = malloc(sizeof(uint64_t)*conn.count_props);
sna_output->dpms_mode = DPMSModeOff;
+ conn.count_encoders = 0;
+
conn.count_modes = 1;
conn.modes_ptr = (uintptr_t)&dummy;
conn.prop_values_ptr = (uintptr_t)sna_output->prop_values;
if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &conn))
- return false;
+ goto cleanup;
/* statically constructed property list */
assert(sna_output->num_props == conn.count_props);