lkml.org 
[lkml]   [2019]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH 4/7] drm/omap: fix possible object reference leak
From
Date
> @@ -208,8 +208,10 @@  static int __init omapdss_boot_init(void)
>
> dss = of_find_matching_node(NULL, omapdss_of_match);
>
> - if (dss == NULL || !of_device_is_available(dss))
> + if (dss == NULL || !of_device_is_available(dss)) {
> + of_node_put(dss);
> return 0;
> + }

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/gpu/drm/omapdrm/dss/omapdss-boot-init.c?id=61de49cb596710b918f7a80839f0b6de2017bc32#n203

Can it be nicer to add a jump target here?

+ if (!dss || !of_device_is_available(dss))
- return 0;
+ goto put_node;


>
> omapdss_walk_device(dss, true);
>
> @@ -234,6 +236,7 @@ static int __init omapdss_boot_init(void)
> kfree(n);
> }
>

+put_node:

> + of_node_put(dss);
> return 0;
> }


Regards,
Markus

\
 
 \ /
  Last update: 2019-04-04 22:43    [W:0.119 / U:1.708 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site