nuttx/drivers/analog
hanzhijian fa1589a697 drivers/analog: fix dead free and memory leak in mcp48xx and mcp47x6.
mcp48xx_initialize() and mcp47x6_initialize() share the same two bugs
in their allocation error paths:

1. Dead code: when the first kmm_malloc() fails and priv is NULL, the
   code calls free(priv) which is a no-op on NULL.  Remove it.

2. Memory leak: when the second kmm_malloc() fails (dacdev), the
   function returns NULL without freeing the already-allocated priv.
   Add kmm_free(priv) before the return.

Signed-off-by: hanzj <hanzhijian@zepp.com>
2026-05-28 02:18:58 +02:00
..
ad5410.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
adc.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ads1115.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ads1242.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ads1255.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ads7046.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ads7828.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
CMakeLists.txt drivers/analog/ads7046: Add support for ADS7046 ADC 2025-08-22 00:29:55 +08:00
comp.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
dac.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
dac7554.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
dac7571.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
hx711.c style: fix spelling in code comments and strings 2025-05-23 10:48:41 +08:00
Kconfig drivers/analog/ads7046: Add support for ADS7046 ADC 2025-08-22 00:29:55 +08:00
lmp92001.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
ltc1867l.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
Make.defs drivers/analog/ads7046: Add support for ADS7046 ADC 2025-08-22 00:29:55 +08:00
max1161x.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
mcp47x6.c drivers/analog: fix dead free and memory leak in mcp48xx and mcp47x6. 2026-05-28 02:18:58 +02:00
mcp48xx.c drivers/analog: fix dead free and memory leak in mcp48xx and mcp47x6. 2026-05-28 02:18:58 +02:00
mcp3008.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
opamp.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
pga11x.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00