From 6673ded76c679ef17097782a13754ba905b917f8 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 28 Aug 2019 14:25:55 +0200 Subject: pc-bios/s390-ccw: Do not pre-initialize empty array Since commit 339686a358b11a231aa5b6d1424e7a1460d7f277 ("pc-bios/s390-ccw: zero out bss section"), we are clearing now the BSS in start.S, so there is no need to pre-initialize the loadparm_str array with zeroes anymore. Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pc-bios') diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c index a69c733..a21b386 100644 --- a/pc-bios/s390-ccw/main.c +++ b/pc-bios/s390-ccw/main.c @@ -17,7 +17,7 @@ char stack[PAGE_SIZE * 8] __attribute__((__aligned__(PAGE_SIZE))); static SubChannelId blk_schid = { .one = 1 }; -static char loadparm_str[LOADPARM_LEN + 1] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +static char loadparm_str[LOADPARM_LEN + 1]; QemuIplParameters qipl; IplParameterBlock iplb __attribute__((__aligned__(PAGE_SIZE))); static bool have_iplb; -- cgit v1.1 From 09be82ce53e8269412544521d449c44305beccf3 Mon Sep 17 00:00:00 2001 From: Yifan Luo Date: Wed, 14 Aug 2019 14:14:26 +0800 Subject: pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid() There is a possible memory leak in get_uuid(). Should free allocated mem before return NULL. Signed-off-by: Yifan Luo Message-Id: <02cf01d55267$86cf2850$946d78f0$@cmss.chinamobile.com> Reviewed-by: Thomas Huth Reviewed-by: Cornelia Huck Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/netmain.c | 1 + 1 file changed, 1 insertion(+) (limited to 'pc-bios') diff --git a/pc-bios/s390-ccw/netmain.c b/pc-bios/s390-ccw/netmain.c index f3542cb..f2dcc01 100644 --- a/pc-bios/s390-ccw/netmain.c +++ b/pc-bios/s390-ccw/netmain.c @@ -269,6 +269,7 @@ static const char *get_uuid(void) : "d" (r0), "d" (r1), [addr] "a" (buf) : "cc", "memory"); if (cc) { + free(mem); return NULL; } -- cgit v1.1 From 6b2a203579068127d7e93cb6f45d828ca04a2153 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Wed, 18 Sep 2019 17:46:02 +0200 Subject: pc-bios/s390-ccw: Rebuild the s390-netboot.img firmware image The new image now contains the "pc-bios/s390-ccw/net: fix a possible memory leak in get_uuid()" patch. Signed-off-by: Thomas Huth --- pc-bios/s390-netboot.img | Bin 67232 -> 67232 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'pc-bios') diff --git a/pc-bios/s390-netboot.img b/pc-bios/s390-netboot.img index aa90fbc..b984ad0 100644 Binary files a/pc-bios/s390-netboot.img and b/pc-bios/s390-netboot.img differ -- cgit v1.1