lkml.org 
[lkml]   [2019]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 05/10] device property: Add a function to obtain a node's prefix
On Thu, Aug 29, 2019 at 01:10:38PM +0300, Sakari Ailus wrote:
> The prefix is used for printing purpose before a node, and it also works
> as a separator between two nodes.

> + /* Is this the root node? */
> + parent = fwnode_get_parent(fwnode);
> + if (!parent)
> + return "";
> +
> + /* Is this 2nd node from the root? */
> + parent = fwnode_get_next_parent(parent);
> + if (!parent)

Can we theoretically have a case when we got parent != NULL and thus taken
reference, while the 2nd one is NULL and we leak reference here (and in all
similar places)?

> + return "";
> +
> + fwnode_handle_put(parent);

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2019-08-30 14:48    [W:0.327 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site