Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mtd: ubi: fix unreleased fwnode_handle in find_volume_fwnode()

The 'fw_vols' fwnode_handle initialized via
device_get_named_child_node() requires explicit calls to
fwnode_handle_put() when the variable is no longer required.

Add the missing calls to fwnode_handle_put() before the function
returns.

Cc: stable@vger.kernel.org
Fixes: 51932f9fc487 ("mtd: ubi: populate ubi volume fwnode")
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>

authored by

Javier Carrasco and committed by
Richard Weinberger
07593293 4617fb8f

+2
+2
drivers/mtd/ubi/vmt.c
··· 143 143 vol->vol_id != volid) 144 144 continue; 145 145 146 + fwnode_handle_put(fw_vols); 146 147 return fw_vol; 147 148 } 149 + fwnode_handle_put(fw_vols); 148 150 149 151 return NULL; 150 152 }