[PATCH] aiodev: mc13xxx_adc: zero-initialize struct aiochannel

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Jul 16 04:56:21 PDT 2024


The mc13xxx_adc driver is the only driver that doesn't allocate the
channels from pre-zeroed memory. The aiodev core doesn't currently
require it, but we may want to in the future, so let's explicitly
zero the channel like all other drivers do.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/aiodev/mc13xxx_adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/aiodev/mc13xxx_adc.c b/drivers/aiodev/mc13xxx_adc.c
index 21eea1f525af..4d80ee57e3f5 100644
--- a/drivers/aiodev/mc13xxx_adc.c
+++ b/drivers/aiodev/mc13xxx_adc.c
@@ -196,7 +196,7 @@ int mc13xxx_adc_probe(struct device *dev, struct mc13xxx *mc_dev)
 
 	mc13xxx_adc->mc_dev = mc_dev;
 	mc13xxx_adc->aiodev.num_channels = chans;
-	mc13xxx_adc->aiochan = xmalloc(mc13xxx_adc->aiodev.num_channels *
+	mc13xxx_adc->aiochan = xzalloc(mc13xxx_adc->aiodev.num_channels *
 			sizeof(*mc13xxx_adc->aiochan));
 	mc13xxx_adc->aiodev.hwdev = dev;
 	mc13xxx_adc->aiodev.channels =
-- 
2.39.2




More information about the barebox mailing list