summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-09-14 08:56:15 +0200
committerGerd Hoffmann <kraxel@redhat.com>2018-09-14 11:44:59 +0200
commit6f19eb21a2ef9a2da938106ccc98e296ee02f4d3 (patch)
tree8aa2645e1b5dcd517b54afefb77bc23fd60144ae
parentdrm/amdgpu: Use per-device driver_features to disable atomic (diff)
downloadlinux-6f19eb21a2ef9a2da938106ccc98e296ee02f4d3.tar.xz
linux-6f19eb21a2ef9a2da938106ccc98e296ee02f4d3.zip
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: Dan Carpenter <dan.carpenter@oracle.com> Link: http://patchwork.freedesktop.org/patch/msgid/20180914065615.GA12043@mwanda Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--drivers/dma-buf/udmabuf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index 9edabce0b8ab..5b44ef226904 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -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: