mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
efi_loader: add protection for block_dev
Check the value of block_dev before to use this pointer. This patch solves problem for the command "load" when ubifs is previously mounted: in this case the function blk_get_device_part_str("ubi 0") don't return error but return block_dev = NULL and then data abort. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
parent
07805f203b
commit
74f5baa28b
1 changed files with 1 additions and 1 deletions
|
@ -968,7 +968,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
|
|||
if (!is_net) {
|
||||
part = blk_get_device_part_str(dev, devnr, &desc, &fs_partition,
|
||||
1);
|
||||
if (part < 0)
|
||||
if (part < 0 || !desc)
|
||||
return EFI_INVALID_PARAMETER;
|
||||
|
||||
if (device)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue