RE: [PATCH rdma-next v2] RDMA/restrack: Don't rely on uninitialized variable in restrack_add flow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 
> On Fri, Mar 16, 2018 at 05:35:21PM +0200, Leon Romanovsky wrote:
> > > > diff --git a/drivers/infiniband/core/restrack.c
> > > > b/drivers/infiniband/core/restrack.c
> > > > index e1d9934d6e81..4cad0cd9aa0c 100644
> > > > +++ b/drivers/infiniband/core/restrack.c
> > > > @@ -113,13 +113,15 @@ void rdma_restrack_add(struct
> rdma_restrack_entry
> > > > *res)
> > > >       if (!dev)
> > > >               return;
> > > >
> > > > +     if (res->type != RDMA_RESTRACK_CM_ID || !res_is_user(res))
> > > > +             res->task = NULL;
> > > > +
> > > >       if (res_is_user(res)) {
> > > >               if (!res->task)
> > > >                       rdma_restrack_set_task(res, current);
> > > >               res->kern_name = NULL;
> > > >       } else {
> > > >               set_kern_name(res);
> > > > -             res->task = NULL;
> > > >       }
> > > >
> > > >       kref_init(&res->kref);
> > >
> > > Since the else {} close (kernel mode) already initializes res->task to
NULL,
> > > you can move the test inside the 'if (res_is_user)' block and simplify
the
> > > test.  Yea?  Something like
> > >
> > > if (res->type != CM_ID || !res->task)
> > >     set_task(current)
> > >
> > > I think that'll work no?
> > >
> > >
> > >
> > > Yes, it will work and I had this version in mind, but decided to send
this
> > > variant.
> >
> >
> > Jaason, Doug,
> >
> > Can you please apply this patch? The rdma-next is broken without it.
> 
> I was waiting for Steve to reply to you.. Steve?
> 
> It seems like patchworks missed some of this thread too, strange..

I'm not sure why you don't like my proposal, but:

Reviewed-by: Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx>


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux