efi: fix memory leak in error path
Subsystems (2)
PATCH 3/5 fs: efi: avoid comparison with uninitialized variable
In reply to Lucas Stachvolume will only be initialized when efi_loaded_image is set.
Signed-off-by Lucas Stach <[email protected]>
--- fs/efi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/efi.c +1 -1
@@ -527,7 +527,7 @@ int efi_fs_probe(struct efi_device *efidev)BS ->handle_protocol (efi_loaded_image->device_handle, &efi_simple_file_system_protocol_guid, (void *)&volume); -if (efidev->protocol == volume) +if (efi_loaded_image && efidev->protocol == volume) path =xstrdup ("/boot" );else path =asprintf ("/efi%d" , index);
Signature · 7 lines
2.5.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 5/5 ratp: use proper defines for BAREBOX_CMD
In reply to Lucas StachSigned-off-by Lucas Stach <[email protected]>
--- common/ratp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/ratp.c +1 -1
@@ -410,7 +410,7 @@ static int do_ratp_close(int argc, char *argv[])BAREBOX_CMD_START (ratp_close) .cmd = do_ratp_close, -}; +BAREBOX_CMD_ENDint barebox_ratp_fs_call (struct ratp_bb_pkt *tx,struct ratp_bb_pkt **rx) {
Signature · 7 lines
2.5.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 1/5 efi: fix memory leak in error path
Signed-off-by Lucas Stach <[email protected]>
--- arch/efi/efi/efi-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/efi/efi/efi-device.c +3 -1
@@ -168,8 +168,10 @@ static struct efi_device *efi_add_device(efi_handle_t *handle, efi_guid_t **guid efiret =BS ->open_protocol (handle, &efi_device_path_protocol_guid, &devpath,NULL ,NULL ,EFI_OPEN_PROTOCOL_GET_PROTOCOL ); -if (EFI_ERROR (efiret)) +if (EFI_ERROR (efiret)) { +free (guidarr);return ERR_PTR (-EINVAL ); + } efidev =xzalloc (sizeof (*efidev));
Signature · 7 lines
2.5.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/5 net: efi: correct function signature of set_ethaddr
Signed-off-by Lucas Stach <[email protected]>
--- drivers/net/efi-snp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/efi-snp.c +1 -1
@@ -238,7 +238,7 @@ static int efi_snp_get_ethaddr(struct eth_device *edev, unsigned char *adr)return 0 ; } -static int efi_snp_set_ethaddr (struct eth_device *edev,unsigned char *adr) +static int efi_snp_set_ethaddr (struct eth_device *edev,const unsigned char *adr) {return 0 ; }
Signature · 7 lines
2.5.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 4/5 bbu: use correct printf format specifier for size_t
In reply to Lucas StachSigned-off-by Lucas Stach <[email protected]>
--- common/bbu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/bbu.c +1 -1
@@ -187,7 +187,7 @@ static int bbu_std_file_handler(struct bbu_handler *handler, oflags |=O_CREAT ; }else {if (!S_ISREG (s.st_mode) && s.st_size < data->len) { -printf ("Image (%lld) is too big for device (%d)\n" , +printf ("Image (%lld) is too big for device (%zd)\n" , s.st_size, data->len); } }
Signature · 7 lines
2.5.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 4 lines · Lucas Stach
Signed-off-by Lucas Stach <[email protected]>--- arch/efi/efi/efi-device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Applied all to master, thanks
Sascha
Quoted 26 lines
arch/efi/efi/efi-device.c +3
-1@@ -168,8 +168,10 @@ static struct efi_device *efi_add_device(efi_handle_t *handle, efi_guid_t **guid efiret =BS ->open_protocol (handle, &efi_device_path_protocol_guid, &devpath,NULL ,NULL ,EFI_OPEN_PROTOCOL_GET_PROTOCOL ); -if (EFI_ERROR (efiret)) +if (EFI_ERROR (efiret)) { +free (guidarr);return ERR_PTR (-EINVAL ); + } efidev =xzalloc (sizeof (*efidev));Signature · 7 lines
2.5.0 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox