IB/mlx4: Check iboe netdev pointer before dereferencing it
authorKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Fri, 10 Aug 2012 18:25:34 +0000 (18:25 +0000)
committerRoland Dreier <roland@purestorage.com>
Thu, 16 Aug 2012 16:38:19 +0000 (09:38 -0700)
commita0675a386a3a68f71e831bd064082e6717b45fdc
treea57632edea051c706e3efedfdfafb0ebf580cf00
parent96f17d590092ae2511adf599a252e8ed1901b7a4
IB/mlx4: Check iboe netdev pointer before dereferencing it

Unlike other parts of the mlx4_ib code, the function build_mlx_header()
doesn't check if the iboe netdev of the given port is valid before
dereferencing it, which can cause a crash if the ethernet interface
has already been taken down.

Fix this by checking for a valid netdev pointer before using it to get
the port MAC address.

Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/mlx4/qp.c