Commit 0a0cbbcb authored by Karsten Graul's avatar Karsten Graul Committed by Zheng Zengkai
Browse files

net/smc: Fix NULL pointer dereference in smc_pnet_find_ib()

stable inclusion
from stable-v5.10.112
commit 35b91e49bc80ca944a8679c3b139ddaf2f8eea0f
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5HL0X

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=35b91e49bc80ca944a8679c3b139ddaf2f8eea0f



--------------------------------

[ Upstream commit d22f4f97 ]

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: af5f60c7 ("net/smc: allow PCI IDs as ib device names in the pnet table")
Reported-by: default avatar <syzbot+03e3e228510223dabd34@syzkaller.appspotmail.com>
Signed-off-by: default avatarKarsten Graul <kgraul@linux.ibm.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent e8dcb506
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment