From: Bart Van Assche <bvanassche@acm.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
njavali@marvell.com, GR-QLogic-Storage-Upstream@marvell.com,
jejb@linux.ibm.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] scsi: qla2xxx: Re-use existing error handling path
Date: Sun, 11 Apr 2021 08:58:52 -0700 [thread overview]
Message-ID: <f237fbd4-2ebf-0105-2a1a-93672cd446cb@acm.org> (raw)
In-Reply-To: <6973844a1532ec2dc8e86f3533362e79d78ed774.1618132821.git.christophe.jaillet@wanadoo.fr>
On 4/11/21 2:21 AM, Christophe JAILLET wrote:
> The code above this hunk looks spurious to me.
>
> It looks like an error handling path (i.e.
> "if (response_len > bsg_job->reply_payload.payload_len)")
> but returns 0, which is the initial value of 'ret'.
>
> Shouldn't we have ret = -<something> here?
Hmm ... if I read that code path correctly it is on purpose that that
code path returns 0 and error reporting happens by reporting the
EXT_STATUS_BUFFER_TOO_SMALL error code to user space.
> ---
> drivers/scsi/qla2xxx/qla_bsg.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
> index aef2f7cc89d3..d42b2ad84049 100644
> --- a/drivers/scsi/qla2xxx/qla_bsg.c
> +++ b/drivers/scsi/qla2xxx/qla_bsg.c
> @@ -2585,8 +2585,8 @@ qla2x00_get_host_stats(struct bsg_job *bsg_job)
>
> data = kzalloc(response_len, GFP_KERNEL);
> if (!data) {
> - kfree(req_data);
> - return -ENOMEM;
> + ret = -ENOMEM;
> + goto host_stat_out;
> }
>
> ret = qla2xxx_get_ini_stats(fc_bsg_to_shost(bsg_job), req_data->stat_type,
Since the above looks good to me:
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
next prev parent reply other threads:[~2021-04-11 15:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-11 9:21 [PATCH] scsi: qla2xxx: Re-use existing error handling path Christophe JAILLET
2021-04-11 15:58 ` Bart Van Assche [this message]
2021-04-16 2:51 ` 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=f237fbd4-2ebf-0105-2a1a-93672cd446cb@acm.org \
--to=bvanassche@acm.org \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=jejb@linux.ibm.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=njavali@marvell.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;
as well as URLs for NNTP newsgroup(s).