Commit Graph

5 Commits

Author SHA1 Message Date
Alan C. Assis
f3d1b6342c mkrd: Fix error: variable 'ret' is uninitialized 2021-08-10 09:08:25 -07:00
Gregory Nutt
3cad9f498f drivers/mkrd.c
drivers/net/telnet.c
 drivers/wireless/bluetooth/bt_uart_bcm4343x.c
 drivers/wireless/ieee802154/mrf24j40/mrf24j40.c

Kernel memory was allocated using kmm_malloc() or kmm_zalloc() but freed with with the user-space allocator free().  In the FLAT build, this is bad style, but not harmful because there is only a single, heap and malloc() and kmm_malloc() map to the same function.

But that is not true in the case of the PROTECTED or KERNEL builds.  In those cases, there are separate heaps.  kmm_malloc() will allocate from the kernel heap.  free() will attempt to free the kernel memory from the user heap and will cause an assertion (or other obscure failure if assertions are disabled).
2020-08-04 13:00:53 -05:00
Gregory Nutt
9628582ced drivers/mkrd.c: Fix a warning found in build testing that occurs when CONFIG_DEBUG_INFO is enabled. 2019-10-26 16:54:59 -06:00
Gregory Nutt
07edaa088c drivers/Kconfig: Add an option, CONFIG_DRVR_MKRD, to control whether or not the mkrd() implementation is build. Otherwise, if mkrd() is built unconditionally, it will be drawn into every build whether it is used or not and will increase the build size. 2019-10-26 11:43:34 -06:00
Gregory Nutt
03bf18d097 drivers/mkrd.c: Forgot to add file in last commit. 2019-10-26 10:24:04 -06:00