Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/drm drm_gem_cma_create_internal can fail.



details:   https://anonhg.NetBSD.org/src/rev/36ba310d6f79
branches:  trunk
changeset: 993110:36ba310d6f79
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 15:27:16 2018 +0000

description:
drm_gem_cma_create_internal can fail.

diffstat:

 sys/external/bsd/drm2/drm/drm_gem_cma_helper.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 110b2c154071 -r 36ba310d6f79 sys/external/bsd/drm2/drm/drm_gem_cma_helper.c
--- a/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c    Mon Aug 27 15:27:04 2018 +0000
+++ b/sys/external/bsd/drm2/drm/drm_gem_cma_helper.c    Mon Aug 27 15:27:16 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drm_gem_cma_helper.c,v 1.4 2018/08/27 15:26:50 riastradh Exp $ */
+/* $NetBSD: drm_gem_cma_helper.c,v 1.5 2018/08/27 15:27:16 riastradh Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.4 2018/08/27 15:26:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: drm_gem_cma_helper.c,v 1.5 2018/08/27 15:27:16 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -254,6 +254,8 @@
        struct drm_gem_cma_object *obj;
 
        obj = drm_gem_cma_create_internal(ddev, size, sgt);
+       if (obj == NULL)
+               return ERR_PTR(-ENOMEM);
 
        return &obj->base;
 }



Home | Main Index | Thread Index | Old Index