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/dist/drm/nouveau/nvif nouveau: Fix con...



details:   https://anonhg.NetBSD.org/src/rev/4bab6258a9c7
branches:  trunk
changeset: 1028471:4bab6258a9c7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 11:07:35 2021 +0000

description:
nouveau: Fix control flow in nvif_object_map.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c |  11 ++++-----
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 7ac426cbec1b -r 4bab6258a9c7 sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c Sun Dec 19 11:07:28 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c Sun Dec 19 11:07:35 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nouveau_nvif_object.c,v 1.7 2021/12/19 11:06:03 riastradh Exp $        */
+/*     $NetBSD: nouveau_nvif_object.c,v 1.8 2021/12/19 11:07:35 riastradh Exp $        */
 
 /*
  * Copyright 2014 Red Hat Inc.
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_nvif_object.c,v 1.7 2021/12/19 11:06:03 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_nvif_object.c,v 1.8 2021/12/19 11:07:35 riastradh Exp $");
 
 #include <nvif/object.h>
 #include <nvif/client.h>
@@ -269,11 +269,10 @@
                        object->map.addr = handle;
                        ret = client->driver->map(client, tag, handle, length,
                            &object->map.handle, &object->map.ptr);
-                       if (ret) {
-                               nvif_object_unmap(object);
-                               return -ENOMEM;
+                       if (ret == 0) {
+                               object->map.size = length;
+                               return 0;
                        }
-                       object->map.size = length;
 #else
                        object->map.ptr = client->driver->map(client,
                                                              handle,



Home | Main Index | Thread Index | Old Index