]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
RDMA/srpt: Fix disabling device management
authorKamal Heib <kamalheib1@gmail.com>
Thu, 14 May 2020 11:47:20 +0000 (14:47 +0300)
committerJason Gunthorpe <jgg@mellanox.com>
Sun, 17 May 2020 23:43:19 +0000 (20:43 -0300)
commit23bbd5818e2b0d265aa1835e66f5055f63a8fa4c
tree000bd68b0e23851776b4d8b41191603b72ae83cc
parentdaeee976904c0b7326eb4c033df7b28d4b726177
RDMA/srpt: Fix disabling device management

Avoid disabling device management for devices that don't support
Management datagrams (MADs) by checking if the "mad_agent" pointer is
initialized before calling ib_modify_port, also fix the error flow in
srpt_refresh_port() to disable device management if
ib_register_mad_agent() fail.

Fixes: 09f8a1486dca ("RDMA/srpt: Fix handling of SR-IOV and iWARP ports")
Link: https://lore.kernel.org/r/20200514114720.141139-1-kamalheib1@gmail.com
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/ulp/srpt/ib_srpt.c