Merge tag 'perf-tools-fixes-for-v5.12-2020-03-07' of git://git.kernel.org/pub/scm...
[linux-2.6-microblaze.git] / drivers / misc / fastrpc.c
index 70eb5ed..f12e909 100644 (file)
@@ -520,12 +520,13 @@ fastrpc_map_dma_buf(struct dma_buf_attachment *attachment,
 {
        struct fastrpc_dma_buf_attachment *a = attachment->priv;
        struct sg_table *table;
+       int ret;
 
        table = &a->sgt;
 
-       if (!dma_map_sgtable(attachment->dev, table, dir, 0))
-               return ERR_PTR(-ENOMEM);
-
+       ret = dma_map_sgtable(attachment->dev, table, dir, 0);
+       if (ret)
+               table = ERR_PTR(ret);
        return table;
 }