Commit 3c80ffbb authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Zheng Zengkai
Browse files

scsi: myrb: Fix up null pointer access on myrb_cleanup()

stable inclusion
from stable-v5.10.122
commit ebfe2797253f64f728855d377fdc7d136fdbcfb5
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5W6OE

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

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

[ Upstream commit f9f0a461 ]

When myrb_probe() fails the callback might not be set, so we need to
validate the 'disable_intr' callback in myrb_cleanup() to not cause a null
pointer exception. And while at it do not call myrb_cleanup() if we cannot
enable the PCI device at all.

Link: https://lore.kernel.org/r/20220523120244.99515-1-hare@suse.de


Reported-by: default avatarZheyu Ma <zheyuma97@gmail.com>
Tested-by: default avatarZheyu Ma <zheyuma97@gmail.com>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent 5321a9b0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment