summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os/linux/os_fence_android_syncpt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/os_fence_android_syncpt.c')
-rw-r--r--drivers/gpu/nvgpu/os/linux/os_fence_android_syncpt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/os_fence_android_syncpt.c b/drivers/gpu/nvgpu/os/linux/os_fence_android_syncpt.c
index dc340f1a..f15d0729 100644
--- a/drivers/gpu/nvgpu/os/linux/os_fence_android_syncpt.c
+++ b/drivers/gpu/nvgpu/os/linux/os_fence_android_syncpt.c
@@ -14,6 +14,7 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16 16
17#include <linux/err.h>
17#include <nvgpu/errno.h> 18#include <nvgpu/errno.h>
18 19
19#include <nvgpu/types.h> 20#include <nvgpu/types.h>
@@ -97,9 +98,9 @@ int nvgpu_os_fence_syncpt_create(
97 struct sync_fence *fence = nvgpu_nvhost_sync_create_fence( 98 struct sync_fence *fence = nvgpu_nvhost_sync_create_fence(
98 nvhost_dev, id, thresh, "fence"); 99 nvhost_dev, id, thresh, "fence");
99 100
100 if (!fence) { 101 if (IS_ERR(fence)) {
101 nvgpu_err(c->g, "error constructing fence %s", "fence"); 102 nvgpu_err(c->g, "error constructing fence %s", "fence");
102 return -ENOMEM; 103 return PTR_ERR(fence);
103 } 104 }
104 105
105 nvgpu_os_fence_init(fence_out, c->g, &syncpt_ops, fence); 106 nvgpu_os_fence_init(fence_out, c->g, &syncpt_ops, fence);
@@ -112,8 +113,9 @@ int nvgpu_os_fence_syncpt_fdget(struct nvgpu_os_fence *fence_out,
112{ 113{
113 struct sync_fence *fence = nvgpu_nvhost_sync_fdget(fd); 114 struct sync_fence *fence = nvgpu_nvhost_sync_fdget(fd);
114 115
115 if (!fence) 116 if (fence == NULL) {
116 return -ENOMEM; 117 return -ENOMEM;
118 }
117 119
118 nvgpu_os_fence_init(fence_out, c->g, &syncpt_ops, fence); 120 nvgpu_os_fence_init(fence_out, c->g, &syncpt_ops, fence);
119 121