All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@stackframe.org>
To: Sathya Prakash <sathya.prakash@broadcom.com>,
	Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
	Suganath Prabu Subramani  <suganath-prabu.subramani@broadcom.com>
Cc: MPT-FusionLinux.pdl@broadcom.com, linux-scsi@vger.kernel.org,
	Helge Deller <deller@gmx.de>
Subject: [PATCH] mpt3sas: add NULL check in _base_fault_reset_work()
Date: Tue, 19 Oct 2021 21:12:08 +0200	[thread overview]
Message-ID: <20211019191208.6546-1-svens@stackframe.org> (raw)

My HP C8000 (an PA-RISC based system) crashed with an HPMC. That
triggered the HPMC handler in the kernel, and i got a crash in
_base_fault_reset_work() from mpt3sas. It looks like this function
calls ioc->schedule_dead_ioc_flush_running_cmds() without checking
whether there's actually a function set, so it dereferences a NULL
pointer on that system. The c8000 actually uses the mptspi driver
instead of mpt3sas which doesn't seem to set this handler.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
Disclaimer: I have no idea about the inner workings of the MPT Fusion drivers.
So this might be completely wrong.

 drivers/message/fusion/mptbase.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 7f7abc9069f7..38f5aa43b457 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -381,7 +381,8 @@ mpt_fault_reset_work(struct work_struct *work)
 		 * since dead ioc will never return any command back from HW.
 		 */
 		hd = shost_priv(ioc->sh);
-		ioc->schedule_dead_ioc_flush_running_cmds(hd);
+		if (ioc->schedule_dead_ioc_flush_running_cmds)
+			ioc->schedule_dead_ioc_flush_running_cmds(hd);
 
 		/*Remove the Dead Host */
 		p = kthread_run(mpt_remove_dead_ioc_func, ioc,
-- 
2.33.0


             reply	other threads:[~2021-10-19 19:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 19:12 Sven Schnelle [this message]
2021-10-21  3:08 ` [PATCH] mpt3sas: add NULL check in _base_fault_reset_work() Martin K. Petersen
2021-10-21  5:40   ` Sven Schnelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211019191208.6546-1-svens@stackframe.org \
    --to=svens@stackframe.org \
    --cc=MPT-FusionLinux.pdl@broadcom.com \
    --cc=deller@gmx.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sathya.prakash@broadcom.com \
    --cc=sreekanth.reddy@broadcom.com \
    --cc=suganath-prabu.subramani@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.