RDMA/irdma: Fix possible crash due to NULL netdev in notifier
authorMustafa Ismail <mustafa.ismail@intel.com>
Mon, 25 Apr 2022 18:17:03 +0000 (13:17 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 May 2022 10:30:15 +0000 (12:30 +0200)
commita61a5582371185461207d650a87bdcc374f23be4
tree047b1dc7df3205d6f13df810f4d7922e345ad2b2
parent22d872b7adce350235aaf6db7e6ee2bb1acbffe3
RDMA/irdma: Fix possible crash due to NULL netdev in notifier

commit 1c9043ae0667a43bd87beeebbdd4bed674713629 upstream.

For some net events in irdma_net_event notifier, the netdev can be NULL
which will cause a crash in rdma_vlan_dev_real_dev.  Fix this by moving
all processing to the NETEVENT_NEIGH_UPDATE case where the netdev is
guaranteed to not be NULL.

Fixes: 6702bc147448 ("RDMA/irdma: Fix netdev notifications for vlan's")
Link: https://lore.kernel.org/r/20220425181703.1634-4-shiraz.saleem@intel.com
Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com>
Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/irdma/utils.c