Re: [PATCH v2] media: imx-jpeg: convert kzalloc_obj() to devm_kzalloc()
From: Marc Kleine-Budde
Date: Mon Mar 09 2026 - 12:10:58 EST
On 08.03.2026 11:35:54, Sanjay Chitroda wrote:
> From: Sanjay Chitroda <sanjayembeddedse@xxxxxxxxx>
>
> The driver allcoates memory using kzalloc_obj() and frees it in the relase
> path. since the allocated memory is tied to the lifetime of the device,
> devm_kzalloc() can be used instead.
What happens if you issue multiple open()/close() cycles per device
lifetime? Will the memory pile up, until the mxc_jpeg_remove() function
is called?
> Using device-managed allocation simplifies the error handling paths and
> remove the need for manual cleanup.
>
> No functional change intended.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Embedded Linux | https://www.pengutronix.de |
Vertretung Nürnberg | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature