]> git.baikalelectronics.ru Git - kernel.git/commit
IB/counters: Always initialize the port counter object
authorParav Pandit <parav@mellanox.com>
Tue, 23 Jul 2019 06:57:33 +0000 (09:57 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Thu, 25 Jul 2019 14:45:48 +0000 (11:45 -0300)
commitc36d9fb3fb4a6b4cda161ec06212367607f3e20f
treea6bb752f11e9478553515003b1f4478bb537ef6b
parent6e1afa945339b09703a7b464d8265faa7e584856
IB/counters: Always initialize the port counter object

Port counter objects should be initialized even if alloc_stats is
unsupported, otherwise QP bind operations in user space can trigger a NULL
pointer deference if they try to bind QP on RDMA device which doesn't
support counters.

Fixes: 25a81ca9f9dd ("RDMA/core: Get sum value of all counters when perform a sysfs stat read")
Link: https://lore.kernel.org/r/20190723065733.4899-11-leon@kernel.org
Signed-off-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Mark Zhang <markz@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/counters.c