From: John Garry <john.garry@huawei.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "James E.J. Bottomley" <JBottomley@odin.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] hisi_sas: fix error codes in hisi_sas_task_prep()
Date: Wed, 9 Dec 2015 13:29:18 +0000 [thread overview]
Message-ID: <56682CAE.7010109@huawei.com> (raw)
In-Reply-To: <20151209104836.GK3173@mwanda>
On 09/12/2015 10:48, Dan Carpenter wrote:
> There were a couple cases where the error codes weren't set and also I
> changed the success return to "return 0;" which is the same as
> "return rc;" but more explicit.
>
> Fixes: 42e7a69368a5 ('hisi_sas: Add ssp command functio')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
> index 2929018..99b1950 100644
> --- a/drivers/scsi/hisi_sas/hisi_sas_main.c
> +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
> @@ -208,15 +208,19 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
> slot->status_buffer = dma_pool_alloc(hisi_hba->status_buffer_pool,
> GFP_ATOMIC,
> &slot->status_buffer_dma);
> - if (!slot->status_buffer)
> + if (!slot->status_buffer) {
> + rc = -ENOMEM;
> goto err_out_slot_buf;
> + }
> memset(slot->status_buffer, 0, HISI_SAS_STATUS_BUF_SZ);
>
> slot->command_table = dma_pool_alloc(hisi_hba->command_table_pool,
> GFP_ATOMIC,
> &slot->command_table_dma);
> - if (!slot->command_table)
> + if (!slot->command_table) {
> + rc = -ENOMEM;
> goto err_out_status_buf;
> + }
> memset(slot->command_table, 0, HISI_SAS_COMMAND_TABLE_SZ);
> memset(slot->cmd_hdr, 0, sizeof(struct hisi_sas_cmd_hdr));
>
> @@ -254,7 +258,7 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_hba *hisi_hba,
> sas_dev->running_req++;
> ++(*pass);
>
> - return rc;
> + return 0;
>
> err_out_sge:
> dma_pool_free(hisi_hba->sge_page_pool, slot->sge_page,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
Looks ok, Thanks.
Tested-by: John Garry <john.garry@huawei.com>
next prev parent reply other threads:[~2015-12-09 13:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-09 10:48 [patch] hisi_sas: fix error codes in hisi_sas_task_prep() Dan Carpenter
2015-12-09 13:29 ` John Garry [this message]
2015-12-10 18:17 ` 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=56682CAE.7010109@huawei.com \
--to=john.garry@huawei.com \
--cc=JBottomley@odin.com \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox