]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: Fix NULL pointer dereference in smc_pnet_find_ib()
authorKarsten Graul <kgraul@linux.ibm.com>
Fri, 8 Apr 2022 15:10:34 +0000 (17:10 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Apr 2022 01:28:03 +0000 (18:28 -0700)
commitf36cebd9d1455669731d32e6fb3536ea41703211
tree44681c5acf227653aaf1a6dd1dae574c8f024b3f
parentfe45bd9dcccc389ed7250b1ede82f64b1d37819a
net/smc: Fix NULL pointer dereference in smc_pnet_find_ib()

dev_name() was called with dev.parent as argument but without to
NULL-check it before.
Solve this by checking the pointer before the call to dev_name().

Fixes: 191982f0d1e7 ("net/smc: allow PCI IDs as ib device names in the pnet table")
Reported-by: syzbot+03e3e228510223dabd34@syzkaller.appspotmail.com
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/smc_pnet.c