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:   Thu, 18 Apr 2019 17:40:44 +0300
From:   Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To:     Andrew Lunn <andrew@...n.ch>
Cc:     David Miller <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Florian Fainelli <f.fainelli@...il.com>,
        Vivien Didelot <vivien.didelot@...il.com>
Subject: Re: [PATCH net-next 08/15] dsa: Keep link list of tag drivers

On 04/18/2019 04:19 PM, Andrew Lunn wrote:

>>> Let the tag drivers register themselves with the DSA core, keeping
>>> them in a linked list.
>>>
>>> Signed-off-by: Andrew Lunn <andrew@...n.ch>
>>> ---
>>>  include/net/dsa.h |  2 ++
>>>  net/dsa/dsa.c     | 35 ++++++++++++++++++++++++++++++++++-
>>>  2 files changed, 36 insertions(+), 1 deletion(-)
>>>
>> [...]
>>> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
>>> index a49e230b6247..861fe1441a7d 100644
>>> --- a/net/dsa/dsa.c
>>> +++ b/net/dsa/dsa.c
>>> @@ -27,6 +27,9 @@
>> [...]
>>>  int dsa_tag_drivers_register(struct dsa_device_ops *ops[],
>>>  			     unsigned int count, struct module *owner)
>>>  {
>>> -	return 0;
>>> +	int err, i;
>>> +
>>> +	for (i = 0; i < count; i++) {
>>> +		err = dsa_tag_driver_register(ops[i], owner);
>>> +		if (err)
>>> +			break;
>>> +	}
>>> +
>>> +	return err;
>>
>>    What if count == 0? Can't happen?
> 
> Hi Sergei
> 
> The current drivers would prevent that. But to be robust, i will add a
> check.

   You'd just need to init the variavble. :-)

> Thanks
> 	Andrew

MBR, Sergei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ