From: Mike Qiu <qiudayu@linux.vnet.ibm.com>
To: Mike Qiu <qiudayu@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org,
tj@kernel.org, haokexin@gmail.com
Subject: Re: [PATCH 2/2] libata: Fix NULL pointer of scsi_host in ata_port
Date: Wed, 23 Jul 2014 10:37:35 +0800 [thread overview]
Message-ID: <53CF1FEF.7050704@linux.vnet.ibm.com> (raw)
In-Reply-To: <1406040688-1762-1-git-send-email-qiudayu@linux.vnet.ibm.com>
On 07/22/2014 10:51 PM, Mike Qiu wrote:
> In ata_sas_port_alloc(), it haven't initialized scsi_host field in
> ata_port, although scsi_host is in parameters list and unused in this
> function.
>
> With commit 1871ee134b73 ("libata: support the ata host which implements a queue depth less than 32")
> ata_qc_new() try to use scsi_host, while it
> is a NULL pointer for ipr IOA and error message shows below:
...
>
> While scsi_host is unused in ata_sas_port_alloc(), better to set it
> in ata_sas_port_alloc() instead of in driver.
>
> Signed-off-by: Mike Qiu <qiudayu@linux.vnet.ibm.com>
> ---
> drivers/ata/libata-scsi.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index 0586f66..a472b6f 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
> @@ -4070,6 +4070,7 @@ struct ata_port *ata_sas_port_alloc(struct ata_host *host,
> ap->flags |= port_info->flags;
> ap->ops = port_info->port_ops;
> ap->cbl = ATA_CBL_SATA;
> + ap->scsi_host = shost;
What about my patch itself, ata_sas_port_alloc() has "shot" in
parameters list, but unused.
Maybe better to set ap->scsi_host here, it is very convenient, and
drivers, like ipr, may forget to set this field, otherwise "shot" need
to be removed from parameters list I think.
Thanks,
Mike
> return ap;
> }
prev parent reply other threads:[~2014-07-23 2:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-22 14:51 [PATCH 2/2] libata: Fix NULL pointer of scsi_host in ata_port Mike Qiu
2014-07-22 14:58 ` Mike Qiu
[not found] ` <CAEuXFExJAq5hpYe8R_De7hOtGN1Jrx6HCQt0tQBAKnDTKEpaBA@mail.gmail.com>
2014-07-22 20:11 ` Tejun Heo
2014-07-23 2:29 ` Mike Qiu
2014-07-23 9:03 ` Alexey Kardashevskiy
2014-07-24 22:29 ` Jesse Brandeburg
2014-07-23 14:46 ` [PATCH libata/for-3.16-fixes] libata: introduce ata_host->n_tags to avoid oops on SAS controllers Tejun Heo
2014-07-23 16:31 ` Bartlomiej Zolnierkiewicz
2014-07-23 16:36 ` Tejun Heo
2014-07-23 16:46 ` Bartlomiej Zolnierkiewicz
2014-07-23 17:20 ` Tejun Heo
2014-07-22 19:47 ` [PATCH 2/2] libata: Fix NULL pointer of scsi_host in ata_port Peter Hurley
2014-07-23 2:37 ` Mike Qiu [this message]
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=53CF1FEF.7050704@linux.vnet.ibm.com \
--to=qiudayu@linux.vnet.ibm.com \
--cc=haokexin@gmail.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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 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.