]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
RDMA/ionic: Fix potential NULL pointer dereference in ionic_query_port
authorKamal Heib <kheib@redhat.com>
Fri, 20 Feb 2026 22:21:26 +0000 (17:21 -0500)
committerLeon Romanovsky <leon@kernel.org>
Tue, 24 Feb 2026 09:54:10 +0000 (04:54 -0500)
commitfd80bd7105f88189f47d465ca8cb7d115570de30
tree91802ff4c5ee919990bc541a63fa7a83c576a5e3
parent3d2e5d12a2eef0ca8a629a422aa593673235c77c
RDMA/ionic: Fix potential NULL pointer dereference in ionic_query_port

The function ionic_query_port() calls ib_device_get_netdev() without
checking the return value which could lead to NULL pointer dereference,
Fix it by checking the return value and return -ENODEV if the 'ndev' is
NULL.

Fixes: 2075bbe8ef03 ("RDMA/ionic: Register device ops for miscellaneous functionality")
Signed-off-by: Kamal Heib <kheib@redhat.com>
Link: https://patch.msgid.link/20260220222125.16973-2-kheib@redhat.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/ionic/ionic_ibdev.c