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, 28 Jun 2016 17:55:27 +0200
From:	Oliver Hartkopp <socketcan@...tkopp.net>
To:	Holger Schurig <holgerschurig@...il.com>,
	Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
	Marc Kleine-Budde <mkl@...gutronix.de>, netdev@...r.kernel.org
Cc:	davem@...emloft.net, linux-can@...r.kernel.org,
	kernel@...gutronix.de, stable@...r.kernel.org
Subject: Re: [PATCH 2/3] can: fix oops caused by wrong rtnl dellink usage

On 06/28/2016 09:36 AM, Holger Schurig wrote:
>> static void can_dellink(struct net_device *dev, struct list_head *head);
>>
>> and
>>
>> static void can_dellink(struct net_device *dev, struct list_head *head)
>> {
>> 	return;
>> }
>
> Wouldn't the canonical form be this:
>
> static void can_dellink(struct net_device *dev, struct list_head *head)
> {
> }
>
>
> - the curly braces make sure this isn't a forward definition
> - but no useless return either
>
>
> But then again, this "return" is only cosmetical.

Yes it is just coding style.

 > No compiler will
> generate any code from it.

ACK.

If you check

	~/linux$ git grep \{\ return\;

there are many occurrences of empty void functions having a 'return' 
inside the curly braces.

I think

	static void can_dellink( ... ){}

would have made it too.

Now can_dellink() just locks similar to can_newlink() some lines above.

Regards,
Oliver

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ