mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/5] efi: fix memory leak in error path
@ 2016-03-02 20:50 Lucas Stach
  2016-03-02 20:50 ` [PATCH 2/5] net: efi: correct function signature of set_ethaddr Lucas Stach
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Lucas Stach @ 2016-03-02 20:50 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/efi/efi/efi-device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/efi/efi/efi-device.c b/arch/efi/efi/efi-device.c
index 7db8e48..678a283 100644
--- a/arch/efi/efi/efi-device.c
+++ b/arch/efi/efi/efi-device.c
@@ -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));
 
-- 
2.5.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/5] net: efi: correct function signature of set_ethaddr
  2016-03-02 20:50 [PATCH 1/5] efi: fix memory leak in error path Lucas Stach
@ 2016-03-02 20:50 ` Lucas Stach
  2016-03-02 20:50 ` [PATCH 3/5] fs: efi: avoid comparison with uninitialized variable Lucas Stach
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2016-03-02 20:50 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 drivers/net/efi-snp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/efi-snp.c b/drivers/net/efi-snp.c
index 5b96fbf..963d539 100644
--- a/drivers/net/efi-snp.c
+++ b/drivers/net/efi-snp.c
@@ -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;
 }
-- 
2.5.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 3/5] fs: efi: avoid comparison with uninitialized variable
  2016-03-02 20:50 [PATCH 1/5] efi: fix memory leak in error path Lucas Stach
  2016-03-02 20:50 ` [PATCH 2/5] net: efi: correct function signature of set_ethaddr Lucas Stach
@ 2016-03-02 20:50 ` Lucas Stach
  2016-03-02 20:50 ` [PATCH 4/5] bbu: use correct printf format specifier for size_t Lucas Stach
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2016-03-02 20:50 UTC (permalink / raw)
  To: barebox

volume will only be initialized when efi_loaded_image is
set.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 fs/efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/efi.c b/fs/efi.c
index a7adcb9..0f74cda 100644
--- a/fs/efi.c
+++ b/fs/efi.c
@@ -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);
-- 
2.5.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 4/5] bbu: use correct printf format specifier for size_t
  2016-03-02 20:50 [PATCH 1/5] efi: fix memory leak in error path Lucas Stach
  2016-03-02 20:50 ` [PATCH 2/5] net: efi: correct function signature of set_ethaddr Lucas Stach
  2016-03-02 20:50 ` [PATCH 3/5] fs: efi: avoid comparison with uninitialized variable Lucas Stach
@ 2016-03-02 20:50 ` Lucas Stach
  2016-03-02 20:50 ` [PATCH 5/5] ratp: use proper defines for BAREBOX_CMD Lucas Stach
  2016-03-04  6:55 ` [PATCH 1/5] efi: fix memory leak in error path Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2016-03-02 20:50 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 common/bbu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/bbu.c b/common/bbu.c
index 4d71fa4..fc82193 100644
--- a/common/bbu.c
+++ b/common/bbu.c
@@ -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);
 		}
 	}
-- 
2.5.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 5/5] ratp: use proper defines for BAREBOX_CMD
  2016-03-02 20:50 [PATCH 1/5] efi: fix memory leak in error path Lucas Stach
                   ` (2 preceding siblings ...)
  2016-03-02 20:50 ` [PATCH 4/5] bbu: use correct printf format specifier for size_t Lucas Stach
@ 2016-03-02 20:50 ` Lucas Stach
  2016-03-04  6:55 ` [PATCH 1/5] efi: fix memory leak in error path Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Lucas Stach @ 2016-03-02 20:50 UTC (permalink / raw)
  To: barebox

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 common/ratp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/ratp.c b/common/ratp.c
index 2fef3cc..edd20dc 100644
--- a/common/ratp.c
+++ b/common/ratp.c
@@ -410,7 +410,7 @@ static int do_ratp_close(int argc, char *argv[])
 
 BAREBOX_CMD_START(ratp_close)
 	.cmd	= do_ratp_close,
-};
+BAREBOX_CMD_END
 
 int barebox_ratp_fs_call(struct ratp_bb_pkt *tx, struct ratp_bb_pkt **rx)
 {
-- 
2.5.0


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/5] efi: fix memory leak in error path
  2016-03-02 20:50 [PATCH 1/5] efi: fix memory leak in error path Lucas Stach
                   ` (3 preceding siblings ...)
  2016-03-02 20:50 ` [PATCH 5/5] ratp: use proper defines for BAREBOX_CMD Lucas Stach
@ 2016-03-04  6:55 ` Sascha Hauer
  4 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2016-03-04  6:55 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Wed, Mar 02, 2016 at 09:50:33PM +0100, Lucas Stach wrote:
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> ---
>  arch/efi/efi/efi-device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Applied all to master, thanks

Sascha

> 
> diff --git a/arch/efi/efi/efi-device.c b/arch/efi/efi/efi-device.c
> index 7db8e48..678a283 100644
> --- a/arch/efi/efi/efi-device.c
> +++ b/arch/efi/efi/efi-device.c
> @@ -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));
>  
> -- 
> 2.5.0
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
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
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-04  6:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-02 20:50 [PATCH 1/5] efi: fix memory leak in error path Lucas Stach
2016-03-02 20:50 ` [PATCH 2/5] net: efi: correct function signature of set_ethaddr Lucas Stach
2016-03-02 20:50 ` [PATCH 3/5] fs: efi: avoid comparison with uninitialized variable Lucas Stach
2016-03-02 20:50 ` [PATCH 4/5] bbu: use correct printf format specifier for size_t Lucas Stach
2016-03-02 20:50 ` [PATCH 5/5] ratp: use proper defines for BAREBOX_CMD Lucas Stach
2016-03-04  6:55 ` [PATCH 1/5] efi: fix memory leak in error path Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox