[PATCH 0/3] media: i2c: Adopt scope-based fwnode_handle_put

From: Biren Pandya

Date: Mon Jun 15 2026 - 18:35:05 EST


This series updates the firmware node parsing logic across three highly active
V4L2 I2C sensor drivers (ov5640, imx290, and imx219) to utilize the modern
__free(fwnode_handle) scoped guard macro introduced in <linux/cleanup.h>.

By binding the lifecycle of the fwnode_handle directly to the variable's scope,
we eliminate the need for manual fwnode_handle_put() calls. This permanently
removes the risk of subtle early-free or missing-put memory leaks in
error-handling paths and establishes a cleaner pattern for newly merged
drivers to follow.

Biren Pandya (3):
media: i2c: ov5640: Drop manual fwnode_handle_put() via scope-based
cleanup
media: i2c: imx290: Drop manual fwnode_handle_put() via scope-based
cleanup
media: i2c: imx219: Drop manual fwnode_handle_put() via scope-based
cleanup

drivers/media/i2c/imx219.c | 6 +++---
drivers/media/i2c/imx290.c | 6 +++---
drivers/media/i2c/ov5640.c | 7 +++----
3 files changed, 9 insertions(+), 10 deletions(-)

--
2.50.1 (Apple Git-155)