From: BALATON Zoltan Date: Sat, 1 Mar 2025 14:35:35 +0000 (+0100) Subject: hw/nvram/eeprom_at24c: Remove memset after g_malloc0 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=902cc3c59eb64bfff95a32de11151209779d118e;p=qemu.git hw/nvram/eeprom_at24c: Remove memset after g_malloc0 Calling memset to zero memory is not needed after g_malloc0 which already clears memory. These used to be in separate functions but after some patches the memset ended up after g_malloc0 and thus can be dropped. Fixes: 4f2c6448c3 (hw/nvram/eeprom_at24c: Make reset behavior more like hardware) Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daudé Message-ID: Signed-off-by: Philippe Mathieu-Daudé --- diff --git a/hw/nvram/eeprom_at24c.c b/hw/nvram/eeprom_at24c.c index 9f606842eb..78c81bea77 100644 --- a/hw/nvram/eeprom_at24c.c +++ b/hw/nvram/eeprom_at24c.c @@ -190,7 +190,6 @@ static void at24c_eeprom_realize(DeviceState *dev, Error **errp) } ee->mem = g_malloc0(ee->rsize); - memset(ee->mem, 0, ee->rsize); if (ee->init_rom) { memcpy(ee->mem, ee->init_rom, MIN(ee->init_rom_size, ee->rsize));