提交 bfdfcfee 编写于 作者: C Colin Ian King 提交者: Roland Dreier

IB/mlx4: fix unitialised variable is_mcast

Commit 297e0dad ("IB/mlx4: Handle Ethernet L2 parameters for IP
based GID addressing") introduced a bug where is_mcast is now no
longer initialized on the non-multicast condition and so it can be
any random value from the stack.  This issue was detected by cppcheck:

    [drivers/infiniband/hw/mlx4/ah.c:103]: (error) Uninitialized
      variable: is_mcast

Simple fix is to initialise is_mcast to zero.
Signed-off-by: NColin Ian King <colin.king@canonical.com>
Signed-off-by: NRoland Dreier <roland@purestorage.com>
上级 d6d211db
......@@ -73,7 +73,7 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
{
struct mlx4_ib_dev *ibdev = to_mdev(pd->device);
struct mlx4_dev *dev = ibdev->dev;
int is_mcast;
int is_mcast = 0;
struct in6_addr in6;
u16 vlan_tag;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册