From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuval Shaia Subject: Re: [PATCH rdma-next 5/5] RDMA/cm: Fix access to uninitialized variable Date: Sun, 28 Jan 2018 13:38:00 +0200 Message-ID: <20180128113759.GD7001@yuvallap> References: <20180128092533.4156-1-leon@kernel.org> <20180128092533.4156-6-leon@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180128092533.4156-6-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Leon Romanovsky Cc: Doug Ledford , Jason Gunthorpe , RDMA mailing list , Jack Morgenstein , Mark Bloch , Parav Pandit , Leon Romanovsky List-Id: linux-rdma@vger.kernel.org On Sun, Jan 28, 2018 at 11:25:33AM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky > > The ndev will be held only for successful ib_get_cached_gid() > and hence no need to use dev_put() in failure path. More than that - in case of an error from ib_get_cached_gid, gid_attr.ndev is still not initialized. > > Fixes: 16c72e402867 ("IB/cm: Refactor to avoid setting path record software only fields") > Signed-off-by: Parav Pandit > Signed-off-by: Leon Romanovsky > --- > drivers/infiniband/core/cm.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c > index 68df93558d80..e6749157fd86 100644 > --- a/drivers/infiniband/core/cm.c > +++ b/drivers/infiniband/core/cm.c > @@ -1901,8 +1901,6 @@ static int cm_req_handler(struct cm_work *work) > grh->sgid_index, > &gid, &gid_attr); > if (ret) { > - if (gid_attr.ndev) > - dev_put(gid_attr.ndev); > ib_send_cm_rej(cm_id, IB_CM_REJ_UNSUPPORTED, NULL, 0, NULL, 0); > goto rejected; > } Reviewed-by: Yuval Shaia > -- > 2.16.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-rdma" in > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html