All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hpsa: fix uninitialized trans_support in hpsa_put_ctlr_into_performant_mode()
@ 2014-04-10 22:17 ` scameron-3C9H9nn4BS4HL6m8NFMY+dBPR1lH4CV8
  0 siblings, 0 replies; 9+ messages in thread
From: scameron @ 2014-04-10 22:17 UTC (permalink / raw)
  To: James Bottomley
  Cc: Bjorn Helgaas, Davidlohr Bueso, Baoquan He, linux-kernel,
	linux-scsi, linux-pci, Joerg Roedel, open list:INTEL IOMMU (VT-d),
	Jiang Liu, scameron


Without this, you'll see a null pointer dereference in
hpsa_enter_performant_mode().

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
---
 drivers/scsi/hpsa.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 8cf4a0c..ef4dfdd 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -7463,6 +7463,10 @@ static void hpsa_put_ctlr_into_performant_mode(struct ctlr_info *h)
 	if (hpsa_simple_mode)
 		return;
 
+	trans_support = readl(&(h->cfgtable->TransportSupport));
+	if (!(trans_support & PERFORMANT_MODE))
+		return;
+
 	/* Check for I/O accelerator mode support */
 	if (trans_support & CFGTBL_Trans_io_accel1) {
 		transMethod |= CFGTBL_Trans_io_accel1 |
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-04-14 15:53 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-10 22:17 [PATCH] hpsa: fix uninitialized trans_support in hpsa_put_ctlr_into_performant_mode() scameron
2014-04-10 22:17 ` scameron-3C9H9nn4BS4HL6m8NFMY+dBPR1lH4CV8
2014-04-10 22:37 ` Davidlohr Bueso
2014-04-11  3:11 ` Baoquan He
2014-04-11  3:11   ` Baoquan He
2014-04-14 15:45 ` James Bottomley
2014-04-14 15:45   ` James Bottomley
2014-04-14 15:52   ` scameron
2014-04-14 15:52     ` scameron-3C9H9nn4BS4HL6m8NFMY+dBPR1lH4CV8

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.