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]
Message-ID: <20210915195034.280bd610@hermes.local>
Date:   Wed, 15 Sep 2021 19:50:34 -0700
From:   Stephen Hemminger <stephen@...workplumber.org>
To:     Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc:     davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] netlink: Remove extra brackets of nla_for_each_attr()

On Thu, 16 Sep 2021 02:07:08 +0000
Jiasheng Jiang <jiasheng@...as.ac.cn> wrote:

> It's obvious that '&(rem)' has unneeded brackets.
> Therefore it's better to remove them.
> 
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
>  include/net/netlink.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/net/netlink.h b/include/net/netlink.h
> index 1ceec51..5822e0d 100644
> --- a/include/net/netlink.h
> +++ b/include/net/netlink.h
> @@ -1920,7 +1920,7 @@ static inline int nla_total_size_64bit(int payload)
>  #define nla_for_each_attr(pos, head, len, rem) \
>  	for (pos = head, rem = len; \
>  	     nla_ok(pos, rem); \
> -	     pos = nla_next(pos, &(rem)))
> +	     pos = nla_next(pos, &rem))
>  
>  /**
>   * nla_for_each_nested - iterate over nested attributes

No.

nla_for_each_attr is a macro and in a macro, there should be
added parenthesis around any use of macro argument to prevent
unintended side effects.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ