]> git.baikalelectronics.ru Git - kernel.git/commit
IB/rdmavt: Only put mmap_info ref if it exists
authorJim Foraker <foraker1@llnl.gov>
Tue, 1 Nov 2016 20:44:12 +0000 (13:44 -0700)
committerDoug Ledford <dledford@redhat.com>
Wed, 14 Dec 2016 17:16:11 +0000 (12:16 -0500)
commit5f4d39ec2ea6867754403c06a97fa16935e3aed3
tree3d0d33f5d42f44c114fb98b26f7f998f129fddf3
parent1d12995c3eb52615d663540f0e1c6e13d4aa261c
IB/rdmavt: Only put mmap_info ref if it exists

rvt_create_qp() creates qp->ip only when a qp creation request comes from
userspace (udata is not NULL).  If we exceed the number of available
queue pairs however, the error path always attempts to put a kref to this
structure.  If the requestor is inside the kernel, this leads to a crash.

We fix this by checking that qp->ip is not NULL before caling kref_put().

Signed-off-by: Jim Foraker <foraker1@llnl.gov>
Acked-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Acked-by: Jonathan Toppins <jtoppins@redhat.com>
Acked-by: Alex Estrin <alex.estrin@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/sw/rdmavt/qp.c