diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-10-06 13:36:02 +0200 |
---|---|---|
committer | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2022-10-06 22:54:57 +0200 |
commit | 01caf28778bfe04838bd4c548ccc975f5a2f59ee (patch) | |
tree | 7f16f7b80877f986e66a5c517f76e206a168c580 /lib/efi_loader/efi_device_path.c | |
parent | 80fadf4af6413f9668f6cfaea39f7a101103ce9e (diff) | |
download | u-boot-01caf28778bfe04838bd4c548ccc975f5a2f59ee.zip u-boot-01caf28778bfe04838bd4c548ccc975f5a2f59ee.tar.gz u-boot-01caf28778bfe04838bd4c548ccc975f5a2f59ee.tar.bz2 |
efi_loader: efi_dp_part_node check dp_alloc return value
dp_alloc() may return NULL. This needs to be caught.
Fixes: 98d48bdf415e ("efi_loader: provide a function to create a partition node")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_device_path.c')
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index ebffb77..acae007 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -936,7 +936,8 @@ struct efi_device_path *efi_dp_part_node(struct blk_desc *desc, int part) dpsize = sizeof(struct efi_device_path_hard_drive_path); buf = dp_alloc(dpsize); - dp_part_node(buf, desc, part); + if (buf) + dp_part_node(buf, desc, part); return buf; } |