lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Jul 2022 19:58:07 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Liang He <windhl@....com>
Cc:     davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
        netdev@...r.kernel.org
Subject: Re: [PATCH v2] net: ftgmac100: Hold reference returned by
 of_get_child_by_name()

On Sun, 10 Jul 2022 10:07:28 +0800 Liang He wrote:
> +static inline struct device_node *ftgmac100_has_child_node(struct device_node *np, const char *name)
> +{
> +	struct device_node *child_np = of_get_child_by_name(np, "mdio");
> +
> +	of_node_put(child_np);
> +
> +	return child_np;

Could you make the return type bool ? We don't have a reference on 
the child_no node, we should probably not return the pointer.

Also the "inline" keyword is unnecessary the compiler will inline 
a small, static function with a single caller, anyway.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ