]> git.baikalelectronics.ru Git - kernel.git/commit
IB/mlx5: Fix use of null pointer PD
authorMajd Dibbiny <majd@mellanox.com>
Thu, 28 Jan 2016 15:51:48 +0000 (17:51 +0200)
committerDoug Ledford <dledford@redhat.com>
Tue, 2 Feb 2016 21:42:22 +0000 (16:42 -0500)
commit1b7204ce2b59c3f1def06963f6218d886ae8859c
tree83eaf9e7dd41596bc83285d9bbfb9ece5a64339b
parent0deab9edd391d9eae4c1743ea90351fc87de0db7
IB/mlx5: Fix use of null pointer PD

When a Raw Ethernet QP is created, a NULL pointer PD could be used.
Fixing that by only using the PD after validating it's valid.
smatch also reported this error:
drivers/infiniband/hw/mlx5/qp.c:1629 mlx5_ib_create_qp()
 error: we previously assumed 'pd' could be null (see line 1616)

Fixes: cd82870d9e45 ('IB/mlx5: Add create and destroy functionality for Raw Packet QP')
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/mlx5/qp.c