jlaitine opened a new pull request, #8114: URL: https://github.com/apache/nuttx/pull/8114
…ero" struct stm32_i2c_inst_s instance is allocated on every call to stm32_i2cbus_initialize, and that instance is supposed to be deleted on every call to stm32_i2cbus_uninitialize. The "refs" counter just keeps track on when the last one is deleted, and everything is unregisterd/disabled after that. This reverts commit 8098c80338eacf0649e3f08c6faff27bdd769334. ## Summary I suggest reverting this patch. Memory leak issue found a constant memory leak on an st32f7 platform which frequently calls stm32_i2cbus_initialize and stm32_i2cbus_uninitialize The whole malloc in these drivers is IMHO useless, for more proper cleanup, something like this can be considered: https://github.com/tiiuae/nuttx/pull/80/commits/d4db1ed31ffc07d90eeffee205f4ad64239d66ea ## Impact Fixes memory leak &eventually out-of-memory condition when a driver initilization fails and is re-tried periodically for some time. ## Testing Tested on stm32f7 (pixhawk 5x) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
