lkml.org 
[lkml]   [2022]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 2/2] RDMA/srp: Fix error return code in srp_parse_options()
On Thu, Dec 01, 2022 at 09:49:51AM +0800, wangyufen wrote:
> 在 2022/12/1 2:00, Bart Van Assche 写道:
> > On 11/29/22 19:31, wangyufen wrote:

...

> case SRP_OPT_CMD_SG_ENTRIES:
> - if (match_int(args, &token) || token < 1 || token >
> 255) {
> + ret = match_int(args, &token);
> + if (ret) {
> + pr_warn("bad max cmd_sg_entries parameter
> '%s'\n",

It's misleading message here. The problem is that parser failed by some reason.
Otherwise this variant seems good one.

> + p);
> + goto out;
> + }
> + if (token < 1 || token > 255) {
> pr_warn("bad max cmd_sg_entries parameter
> '%s'\n",
> p);
> + ret = -EINVAL;
> goto out;
> }
> target->cmd_sg_cnt = token;
> break;

...

> Or the following is better?

Why do you want to shadow actual error code?

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-12-01 13:22    [W:0.050 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site