Skip to content

Commit 0759329

Browse files
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: 51932f9 ("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>
1 parent 4617fb8 commit 0759329

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/mtd/ubi/vmt.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ static struct fwnode_handle *find_volume_fwnode(struct ubi_volume *vol)
143143
vol->vol_id != volid)
144144
continue;
145145

146+
fwnode_handle_put(fw_vols);
146147
return fw_vol;
147148
}
149+
fwnode_handle_put(fw_vols);
148150

149151
return NULL;
150152
}

0 commit comments

Comments
 (0)