[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171027194457.GK16127@mtr-leonro.local>
Date: Fri, 27 Oct 2017 22:44:57 +0300
From: Leon Romanovsky <leon@...nel.org>
To: Dennis Dalessandro <dennis.dalessandro@...el.com>
Cc: SF Markus Elfring <elfring@...rs.sourceforge.net>,
linux-rdma@...r.kernel.org, Doug Ledford <dledford@...hat.com>,
Hal Rosenstock <hal.rosenstock@...il.com>,
Sean Hefty <sean.hefty@...el.com>,
Yishai Hadas <yishaih@...lanox.com>,
Yuval Shaia <yuval.shaia@...cle.com>,
LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] IB/mlx4: Use common error handling code in
__mlx4_ib_create_flow()
On Thu, Oct 26, 2017 at 08:33:39PM -0400, Dennis Dalessandro wrote:
> On 10/26/2017 12:12 PM, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring@...rs.sourceforge.net>
> > Date: Thu, 26 Oct 2017 17:54:15 +0200
> >
> > Add a jump target so that a bit of exception handling can be better reused
> > at the end of this function.
>
> I'm not sure this is that big of a win. I mean you aren't really making the
> code any smaller and it's not making it any easier to read really.
>
> > This issue was detected by using the Coccinelle software.
>
> Assuming there was no testing done for this?
>
> > Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> > ---
> > drivers/infiniband/hw/mlx4/main.c | 10 +++++-----
> > 1 file changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> > index c636842c5be0..4a598c48ea1c 100644
> > --- a/drivers/infiniband/hw/mlx4/main.c
> > +++ b/drivers/infiniband/hw/mlx4/main.c
> > @@ -1691,8 +1691,8 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, struct ib_flow_attr *flow_att
> > mdev, qp, default_table + default_flow,
> > mailbox->buf + size);
> > if (ret < 0) {
> > - mlx4_free_cmd_mailbox(mdev->dev, mailbox);
> > - return -EINVAL;
> > + ret = -EINVAL;
> > + goto free_mailbox;
>
> This might be a good opportunity to bubble up the return value rather than
> just blindly returning -EINVAL. That's really a question for Mellanox
> though.
It is worth to check it, especially for parse_flow_attr() which can
return -ENOTSUPP (need to fix return -EOPNOTSUPP).
Thanks
>
> -Denny
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists