From: John Garry <john.garry@huawei.com>
To: <jejb@linux.vnet.ibm.com>, <martin.petersen@oracle.com>,
<robh+dt@kernel.org>, <mark.rutland@arm.com>
Cc: <linux-scsi@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
Xiang Chen <chenxiang66@hisilicon.com>,
John Garry <john.garry@huawei.com>
Subject: [PATCH 3/3] scsi: hisi_sas: fix a bug in hisi_sas_dev_gone()
Date: Thu, 18 Jan 2018 00:46:54 +0800 [thread overview]
Message-ID: <1516207614-159721-4-git-send-email-john.garry@huawei.com> (raw)
In-Reply-To: <1516207614-159721-1-git-send-email-john.garry@huawei.com>
From: Xiang Chen <chenxiang66@hisilicon.com>
When device gone, NULL pointer can be accessed in
free_device callback if during SAS controller reset
as we clear structure sas_dev prior.
Actually we can only set dev_type as SAS_PHY_UNUSED
and not clear structure sas_dev as all the members
of structure sas_dev will be re-initialized after
device found.
Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---
drivers/scsi/hisi_sas/hisi_sas_main.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 791462d..2d4dbed 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -796,7 +796,6 @@ static void hisi_sas_dev_gone(struct domain_device *device)
hisi_hba->hw->clear_itct(hisi_hba, sas_dev);
device->lldd_dev = NULL;
- memset(sas_dev, 0, sizeof(*sas_dev));
}
if (hisi_hba->hw->free_device)
--
1.9.1
next prev parent reply other threads:[~2018-01-17 15:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-17 16:46 [PATCH 0/3] hisi_sas: v2 hw LED support John Garry
2018-01-17 16:46 ` [PATCH 1/3] devicetree: bindings: scsi: hisi_sas: add LED feature for v2 hw John Garry
2018-01-29 17:27 ` Rob Herring
2018-01-17 16:46 ` [PATCH 2/3] scsi: hisi_sas: directly attached disk " John Garry
2018-01-17 16:46 ` John Garry [this message]
2018-01-19 2:35 ` [PATCH 0/3] hisi_sas: v2 hw LED support Martin K. Petersen
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=1516207614-159721-4-git-send-email-john.garry@huawei.com \
--to=john.garry@huawei.com \
--cc=chenxiang66@hisilicon.com \
--cc=devicetree@vger.kernel.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mark.rutland@arm.com \
--cc=martin.petersen@oracle.com \
--cc=robh+dt@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®