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] [day] [month] [year] [list]
Date:   Tue, 01 Oct 2019 10:27:55 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     andrew@...n.ch
Cc:     o.rempel@...gutronix.de, jcliburn@...il.com, chris.snook@...il.com,
        kernel@...gutronix.de, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v2] net: ag71xx: fix mdio subnode support

From: Andrew Lunn <andrew@...n.ch>
Date: Tue, 1 Oct 2019 18:43:40 +0200

> On Tue, Oct 01, 2019 at 09:03:20AM -0700, David Miller wrote:
>> From: Oleksij Rempel <o.rempel@...gutronix.de>
>> Date: Tue,  1 Oct 2019 08:41:47 +0200
>> 
>> > @@ -571,7 +571,9 @@ static int ag71xx_mdio_probe(struct ag71xx *ag)
>> >  		msleep(200);
>> >  	}
>> >  
>> > -	err = of_mdiobus_register(mii_bus, np);
>> > +	mnp = of_get_child_by_name(np, "mdio");
>> > +	err = of_mdiobus_register(mii_bus, mnp);
>> 
>> of_get_child_by_name() can fail, so error checking is necessary
>> before you pass mnp into of_mdiobus_register().
> 
> Hi David
> 
> /**
>  *	of_get_child_by_name - Find the child node by name for a given parent
>  *	@node:	parent node
>  *	@name:	child name to look for.
>  *
>  *      This function looks for child node for given matching name
>  *
>  *	Returns a node pointer if found, with refcount incremented, use
>  *	of_node_put() on it when done.
>  *	Returns NULL if node is not found.
>  */
> 
> So on error, it returns NULL. And passing NULL to
> of_mdiobus_register() is the correct thing to do if there is no DT
> node. of_node_put() is also O.K. with NULL.
> 
> So this is all O.K. as is.
> 
> Reviewed-by: Andrew Lunn <andrew@...n.ch>

Aha I didn't think about it that way...

Ok I'll apply this thanks.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ