malloc to calloc

This commit is contained in:
Jasmine Iwanek
2025-01-07 00:42:06 -05:00
parent f599e72114
commit 4e6f29a7d5
183 changed files with 245 additions and 493 deletions

View File

@@ -138,8 +138,7 @@ opti291_close(void *priv)
static void *
opti291_init(UNUSED(const device_t *info))
{
opti291_t *dev = (opti291_t *) malloc(sizeof(opti291_t));
memset(dev, 0, sizeof(opti291_t));
opti291_t *dev = (opti291_t *) calloc(1, sizeof(opti291_t));
io_sethandler(0x022, 0x0001, opti291_read, NULL, NULL, opti291_write, NULL, NULL, dev);
io_sethandler(0x024, 0x0001, opti291_read, NULL, NULL, opti291_write, NULL, NULL, dev);