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/core/subdev/bar Fix b...



details:   https://anonhg.NetBSD.org/src/rev/b03943d51a00
branches:  trunk
changeset: 813690:b03943d51a00
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Feb 14 03:06:06 2016 +0000

description:
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.

diffstat:

 sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c |  12 +++++----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r e2d90844ffd5 -r b03943d51a00 sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c
--- a/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c  Sat Feb 13 23:12:34 2016 +0000
+++ b/sys/external/bsd/drm2/dist/drm/nouveau/core/subdev/bar/nouveau_subdev_bar_base.c  Sun Feb 14 03:06:06 2016 +0000
@@ -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 @@
 
 #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;



Home | Main Index | Thread Index | Old Index