<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Kuehling, Felix <Felix.Kuehling@amd.com><br>
<b>Sent:</b> Friday, December 14, 2018 2:05:11 PM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Kuehling, Felix<br>
<b>Subject:</b> [PATCH 1/1] drm/amdkfd: Fix handling of return code of dma_buf_get</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On errors, dma_buf_get returns a negative error code, rather than NULL.<br>
<br>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com><br>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 4 ++--<br>
 1 file changed, 2 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
index 3623538..db6f27f 100644<br>
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c<br>
@@ -1629,8 +1629,8 @@ static int kfd_ioctl_import_dmabuf(struct file *filep,<br>
                 return -EINVAL;<br>
 <br>
         dmabuf = dma_buf_get(args->dmabuf_fd);<br>
-       if (!dmabuf)<br>
-               return -EINVAL;<br>
+       if (IS_ERR(dmabuf))<br>
+               return PTR_ERR(dmabuf);<br>
 <br>
         mutex_lock(&p->mutex);<br>
 <br>
-- <br>
2.7.4<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>