vc/cavium/bdk/libbdk-hal: Fix eye data memory leak
This function can capture and allocate its own eye data, so in that case set need_free to true so it is freed at the end. Change-Id: I63ca6d743e6610d3e3ab6bd7b0356aabdfa6f784 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 1393969 Reviewed-on: https://review.coreboot.org/c/coreboot/+/34591 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
parent
25f9dcb685
commit
43d07f75cf
|
@ -362,9 +362,12 @@ int bdk_qlm_eye_display(bdk_node_t node, int qlm, int qlm_lane, int format, cons
|
||||||
bdk_error("Failed to allocate space for eye\n");
|
bdk_error("Failed to allocate space for eye\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (bdk_qlm_eye_capture(node, qlm, qlm_lane, eye_data))
|
if (bdk_qlm_eye_capture(node, qlm, qlm_lane, eye_data)) {
|
||||||
|
free(eye_data);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
eye = eye_data;
|
eye = eye_data;
|
||||||
|
need_free = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Calculate the max eye width */
|
/* Calculate the max eye width */
|
||||||
|
|
Loading…
Reference in New Issue