Module Name: src
Committed By: riastradh
Date: Sun Feb 14 03:06:06 UTC 2016
Modified Files:
src/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar:
nouveau_subdev_bar_base.c
Log Message:
Fix bus_space_subregion error branch.
Return error code, not 0 (!), on bus_space_subregion failure.
In answer to `XXX error branch' comment: if nouveau_barobj_ctor
fails, then the caller will call nouveau_barobj_dtor too. So there's
no leak here.
Unlikely to fix any observed bugs with nouveau -- there's no error
branch in the Linux side here. But maybe it will catch some other
bug earlier.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.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/core/subdev/bar/nouveau_subdev_bar_base.c
diff -u src/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c:1.3 src/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c:1.4
--- src/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c:1.3 Sun Oct 18 15:42:00 2015
+++ src/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c Sun Feb 14 03:06:06 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: nouveau_subdev_bar_base.c,v 1.3 2015/10/18 15:42:00 jmcneill Exp $ */
+/* $NetBSD: nouveau_subdev_bar_base.c,v 1.4 2016/02/14 03:06:06 riastradh Exp $ */
/*
* Copyright 2012 Red Hat Inc.
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nouveau_subdev_bar_base.c,v 1.3 2015/10/18 15:42:00 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nouveau_subdev_bar_base.c,v 1.4 2016/02/14 03:06:06 riastradh Exp $");
#include <core/object.h>
@@ -66,9 +66,11 @@ nouveau_barobj_ctor(struct nouveau_objec
#ifdef __NetBSD__
barobj->iomemt = bar->iomemt;
- if (bus_space_subregion(bar->iomemt, bar->iomemh, barobj->vma.offset,
- bar->iomemsz - barobj->vma.offset, &barobj->iomemh) != 0)
- /* XXX error branch */
+ /* XXX errno NetBSD->Linux */
+ ret = -bus_space_subregion(bar->iomemt, bar->iomemh,
+ barobj->vma.offset, bar->iomemsz - barobj->vma.offset,
+ &barobj->iomemh);
+ if (ret)
return ret;
#else
barobj->iomem = bar->iomem + (u32)barobj->vma.offset;