From: Hans Verkuil <hans.verk...@cisco.com>

In __qbuf_dmabuf the result of the memop call attach_dmabuf() is checked by
IS_ERR() instead of IS_ERR_OR_NULL(). Since the a NULL pointer makes no sense
and in other places in videobuf2-core the IS_ERR_OR_NULL macro is always used,
I've changed the IS_ERR to IS_ERR_OR_NULL to remain consistent.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>
---
 drivers/media/v4l2-core/videobuf2-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index f9059bb..03d3130 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1403,10 +1403,10 @@ static int __qbuf_dmabuf(struct vb2_buffer *vb, const 
struct v4l2_buffer *b)
                /* Acquire each plane's memory */
                mem_priv = call_memop(vb, attach_dmabuf, q->alloc_ctx[plane],
                        dbuf, planes[plane].length, write);
-               if (IS_ERR(mem_priv)) {
+               if (IS_ERR_OR_NULL(mem_priv)) {
                        dprintk(1, "qbuf: failed to attach dmabuf\n");
                        fail_memop(vb, attach_dmabuf);
-                       ret = PTR_ERR(mem_priv);
+                       ret = mem_priv ? PTR_ERR(mem_priv) : -EINVAL;
                        dma_buf_put(dbuf);
                        goto err;
                }
-- 
1.9.0

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

Reply via email to