Module Name:    src
Committed By:   riastradh
Date:           Sun Dec 19 11:07:36 UTC 2021

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/nouveau/nvif: nouveau_nvif_object.c

Log Message:
nouveau: Fix control flow in nvif_object_map.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
    src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.7 src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.8
--- src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c:1.7	Sun Dec 19 11:06:03 2021
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/nvif/nouveau_nvif_object.c	Sun Dec 19 11:07:35 2021
@@ -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 @@ nvif_object_map(struct nvif_object *obje
 			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,

Reply via email to