Re: [PATCH rdma-rc v1] RDMA/ucma: Ensure that CM_ID exists prior to access it

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

 



On Tue, Mar 20, 2018 at 04:32:48PM +0200, Leon Romanovsky wrote:
> > > diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
> > > index 14c260ed63cb..8bb2f8631b0e 100644
> > > +++ b/drivers/infiniband/core/ucma.c
> > > @@ -132,7 +132,7 @@ static inline struct ucma_context *_ucma_find_context(int id,
> > >  	ctx = idr_find(&ctx_idr, id);
> > >  	if (!ctx)
> > >  		ctx = ERR_PTR(-ENOENT);
> > > -	else if (ctx->file != file)
> > > +	else if (ctx->file != file || IS_ERR_OR_NULL(ctx->cm_id))
> >
> > Still no on IS_ERR_OR_NULL. Don't store err_ptr in ctx->cm_id.
> 
> I'm not storing, it is something that is returned by __rdma_create_id
> for a fraction of second.
> 
> Do you suggest to create temp varaible to store result of
> __rdma_create_id(), test it and only after that update cm_id?

Yes.

Jason
--
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