lkml.org 
[lkml]   [2018]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v7] Add udmabuf misc device
  Hi,

> > + fput(memfd);
> > + }
> > + memfd = NULL;
> Now memfd is NULL

> > + buf = dma_buf_export(&exp_info);
> > + if (IS_ERR(buf)) {
> > + ret = PTR_ERR(buf);
> > + goto err_put_pages;
> Assume an error occured

> > +err_put_pages:
> > + while (pgbuf > 0)
> > + put_page(ubuf->pages[--pgbuf]);
> > +err_free_ubuf:
> > + fput(memfd);
> Now fput it called with NULL, and in fput this is used in

> where the bug is signalled, so I guess fput doesn't accept a null
> pointer.

Indeed. Already fixed in drm-misc-next.

> I'm not sure why you set memfd to NULL at all, because on the following
> non-error path it is not used.

And in the error path it should not be user either, at least when the
error happens *after* exiting the loop, otherwise we would fput twice in
the error case.

> The other question is of course, why did dma_buf_export fail for me ...

What exactly did you try?

cheers,
Gerd

\
 
 \ /
  Last update: 2018-09-10 10:38    [W:0.084 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site