Skip to content

Commit 50af596

Browse files
luo penghaodavem330
authored andcommitted
net/core: Remove unused assignment operations and variable
Although if_info_size is assigned, it has not been used. And the variable should also be deleted. The clang_analyzer complains as follows: net/core/rtnetlink.c:3806: warning: Although the value stored to 'if_info_size' is used in the enclosing expression, the value is never actually read from 'if_info_size'. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: luo penghao <luo.penghao@zte.com.cn> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent c5c6e58 commit 50af596

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎net/core/rtnetlink.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3804,9 +3804,8 @@ struct sk_buff *rtmsg_ifinfo_build_skb(int type, struct net_device *dev,
38043804
struct net *net = dev_net(dev);
38053805
struct sk_buff *skb;
38063806
int err = -ENOBUFS;
3807-
size_t if_info_size;
38083807

3809-
skb = nlmsg_new((if_info_size = if_nlmsg_size(dev, 0)), flags);
3808+
skb = nlmsg_new(if_nlmsg_size(dev, 0), flags);
38103809
if (skb == NULL)
38113810
goto errout;
38123811

0 commit comments

Comments
 (0)