Re: [PATCH] of: property: fix unbalanced of node refcount in of_fwnode_get_reference_args()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Yang,

On Thu, Nov 17, 2022 at 10:56:56PM +0800, Yang Yingliang wrote:
> I got the the following report:
> 
>   OF: ERROR: memory leak, expected refcount 1 instead of 4,
>   of_node_get()/of_node_put() unbalanced - destroy cset entry:
>   attach overlay node /i2c/pmic@34/adc
> 
> In of_fwnode_get_reference_args(), the 'of_args.np' returned
> from of_parse_phandle_with_args(), its refcount is increased
> in of_phandle_iterator_next(), if args is null, the refcount
> of 'of_args.np' need be put to avoid leak.
> 
> Fixes: 3e3119d3088f ("device property: Introduce fwnode_property_get_reference_args")
> Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>

Thanks for the patch!

Reviewed-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>

-- 
Sakari Ailus



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux