* [PATCH 1/1] efi_loader: check return value of part_get_info()
@ 2023-05-27 6:22 Heinrich Schuchardt
0 siblings, 0 replies; only message in thread
From: Heinrich Schuchardt @ 2023-05-27 6:22 UTC (permalink / raw)
To: Ilias Apalodimas; +Cc: u-boot, Heinrich Schuchardt
part_get_info() may return an error code. Check it.
Update function description of dp_part_node().
Addresses-Coverity-ID: 184067 ("Unchecked return value")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
lib/efi_loader/efi_device_path.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index 71923b1127..04ebb449ca 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -843,12 +843,17 @@ static unsigned dp_part_size(struct blk_desc *desc, int part)
* @buf buffer to which the device path is written
* @desc block device descriptor
* @part partition number, 0 identifies a block device
+ *
+ * Return: pointer to position after the node
*/
static void *dp_part_node(void *buf, struct blk_desc *desc, int part)
{
struct disk_partition info;
+ int ret;
- part_get_info(desc, part, &info);
+ ret = part_get_info(desc, part, &info);
+ if (ret < 0)
+ return buf;
if (desc->part_type == PART_TYPE_ISO) {
struct efi_device_path_cdrom_path *cddp = buf;
--
2.39.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-05-27 6:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-27 6:22 [PATCH 1/1] efi_loader: check return value of part_get_info() Heinrich Schuchardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.