Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933584AbbLOQik (ORCPT ); Tue, 15 Dec 2015 11:38:40 -0500 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36402 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933462AbbLOQih (ORCPT ); Tue, 15 Dec 2015 11:38:37 -0500 Subject: Re: [PATCH RESEND] infiniband:core:Add needed error path in cm_init_av_by_path To: Nicholas Krause , dledford@redhat.com References: <1450194724-7107-1-git-send-email-xerofoify@gmail.com> Cc: sean.hefty@intel.com, hal.rosenstock@gmail.com, haggaie@mellanox.com, jgunthorpe@obsidianresearch.com, matanb@mellanox.com, doront@mellanox.com, david.ahern@oracle.com, erezsh@mellanox.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org From: Michael Wang Message-ID: <5670420A.7040202@profitbricks.com> Date: Tue, 15 Dec 2015 17:38:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1450194724-7107-1-git-send-email-xerofoify@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1574 Lines: 48 On 12/15/2015 04:52 PM, Nicholas Krause wrote: > This adds a needed error path in the function, cm_init_av_by_path > after the call to ib_init_ah_from_path in order to avoid incorrectly > accessing the path pointer of structure type ib_sa_path_rec if this > function call fails to complete its intended work successfully by > returning a error code. > > Signed-off-by: Nicholas Krause > --- > drivers/infiniband/core/cm.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c > index 0a26dd6..e9b36ea 100644 > --- a/drivers/infiniband/core/cm.c > +++ b/drivers/infiniband/core/cm.c > @@ -383,8 +383,11 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av) > return ret; > > av->port = port; > - ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path, > - &av->ah_attr); > + ret = ib_init_ah_from_path(cm_dev->ib_device, port->port_num, path, > + &av->ah_attr); ..Just wondering what if the transport don't require GRH? eg inside the same subnet? The hop_limit is only suggest that the package allowed to be routed, not have to, correct? Regards, Michael Wang > + if (ret) > + return ret; > + > av->timeout = path->packet_life_time + 1; > > return 0; > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/