Platform/ARM/BdsLib: maintain alignment for DevicePaths
DevicePath node types may have any size, and so it is up to the code that manipulates them to ensure that dereferencing them only occurs when the pointer is aligned explicitly. Since BdsConnectAndUpdateDevicePath() has only two callers, one of which itself, we can simply duplicate the device path (similar to how DxeCore's CoreConnectController () does it), and free the pool allocation again on the way out. (Note that the allocation only occurs when the non-recursive path is taken and the function returns EFI_SUCCESS) Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by:Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by:
Laszlo Ersek <lersek@redhat.com> Tested-by:
Thomas Abraham <thomas.abraham@arm.com> Reviewed-by:
Leif Lindholm <leif.lindholm@linaro.org>
Loading
Please register or sign in to comment