From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932450AbdJ0Ado (ORCPT ); Thu, 26 Oct 2017 20:33:44 -0400 Received: from mga01.intel.com ([192.55.52.88]:55411 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751651AbdJ0Adm (ORCPT ); Thu, 26 Oct 2017 20:33:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,302,1505804400"; d="scan'208";a="1029924488" Subject: Re: [PATCH] IB/mlx4: Use common error handling code in __mlx4_ib_create_flow() To: SF Markus Elfring , linux-rdma@vger.kernel.org, Doug Ledford , Hal Rosenstock , Leon Romanovsky , Sean Hefty , Yishai Hadas , Yuval Shaia Cc: LKML , kernel-janitors@vger.kernel.org References: <0bcea3cf-91e3-01d5-8d80-34cd6b611fb1@users.sourceforge.net> From: Dennis Dalessandro Message-ID: <70843f43-03c5-8295-643a-4f228ff2e907@intel.com> Date: Thu, 26 Oct 2017 20:33:39 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <0bcea3cf-91e3-01d5-8d80-34cd6b611fb1@users.sourceforge.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/2017 12:12 PM, SF Markus Elfring wrote: > From: Markus Elfring > 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 > --- > 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. -Denny