Re: [PATCH V2 for-next 6/7] IB/core: Add support for fd objects

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

 



On Sun, Mar 19, 2017 at 05:59:04PM +0200, Matan Barak wrote:

> +static void alloc_abort_fd_uobject(struct ib_uobject *uobj)
> +{
> +	struct ib_uobject_file *uobj_file =
> +		container_of(uobj, struct ib_uobject_file, uobj);
> +	struct file *filp = uobj->object;
> +	int id = uobj_file->uobj.id;
> +
> +	/* Unsuccessful NEW */
> +	fput(filp);
> +	put_unused_fd(id);
> +}
> +
> +static int __must_check remove_commit_fd_uobject(struct ib_uobject *uobj,
> +						 enum rdma_remove_reason why)
> +{
> +	const struct uverbs_obj_fd_type *fd_type =
> +		container_of(uobj->type, struct uverbs_obj_fd_type, type);
> +	struct ib_uobject_file *uobj_file =
> +		container_of(uobj, struct ib_uobject_file, uobj);
> +	int ret = fd_type->context_closed(uobj_file, why);
> +
> +	if (why == RDMA_REMOVE_DESTROY && ret)
> +		return ret;
> +
> +	if (why == RDMA_REMOVE_DURING_CLEANUP) {
> +		alloc_abort_fd_uobject(uobj);

Doesn't this call put_unused_fd on a fd that has actually been
installed? That isn't OK...

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