Commit 6f19eb21 authored by Dan Carpenter's avatar Dan Carpenter Committed by Gerd Hoffmann

udmabuf: fix error code in map_udmabuf()

We accidentally forgot to set "ret" on this error path so it means we
return NULL instead of an error pointer.  The caller checks for NULL and
changes it to an error pointer so it doesn't cause an issue at run time.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180914065615.GA12043@mwandaSigned-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 351c4dbe
......@@ -61,8 +61,10 @@ static struct sg_table *map_udmabuf(struct dma_buf_attachment *at,
GFP_KERNEL);
if (ret < 0)
goto err;
if (!dma_map_sg(at->dev, sg->sgl, sg->nents, direction))
if (!dma_map_sg(at->dev, sg->sgl, sg->nents, direction)) {
ret = -EINVAL;
goto err;
}
return sg;
err:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment