]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx4: Avoid null pointer dereference in mlx4_ib_scan_netdevs()
authorMoni Shoua <monis@mellanox.com>
Thu, 21 Aug 2014 11:28:37 +0000 (14:28 +0300)
committerRoland Dreier <roland@purestorage.com>
Mon, 22 Sep 2014 16:46:52 +0000 (09:46 -0700)
commit473c8d4fd5140961141540bd7c7a54a6a326d66d
tree5fdd73c629fe7753fbd4c5b29317df7b96ee9e20
parent2d48fb8e9b28da814fec250fc1dd7f40654fc09c
IB/mlx4: Avoid null pointer dereference in mlx4_ib_scan_netdevs()

When Ethernet netdev is not present for a port (e.g. when the link
layer type of the port is InfiniBand) it's possible to dereference a
null pointer when we do netdevice scanning.

To fix that, we move a section of code that needs to run only when
netdev is present to a proper if () statement.

Fixes: 3d12b5c14862 ("IB/mlx4: Build the port IBoE GID table properly under bonding")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/mlx4/main.c