Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/arch/arm Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/d97eb1fa408d
branches:  netbsd-9
changeset: 963435:d97eb1fa408d
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Dec 17 12:35:11 2019 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #557):

        sys/arch/arm/rockchip/rk_drm.c: revision 1.3
        sys/arch/arm/ti/ti_lcdc.c: revision 1.4
        sys/arch/arm/sunxi/sunxi_drm.c: revision 1.10

ensure to call drm_mode_config_cleanup() when erroring.

tripped up 'active lock in free' checks, and perhaps
lead to other lock corruption.  (crash with un-init lock
in arpresolve that does not make sense now seems to not
occur either.)

diffstat:

 sys/arch/arm/rockchip/rk_drm.c |  12 +++++++-----
 sys/arch/arm/sunxi/sunxi_drm.c |  12 +++++++-----
 sys/arch/arm/ti/ti_lcdc.c      |  15 +++++++++------
 3 files changed, 23 insertions(+), 16 deletions(-)

diffs (154 lines):

diff -r 75847bb17567 -r d97eb1fa408d sys/arch/arm/rockchip/rk_drm.c
--- a/sys/arch/arm/rockchip/rk_drm.c    Tue Dec 17 12:32:52 2019 +0000
+++ b/sys/arch/arm/rockchip/rk_drm.c    Tue Dec 17 12:35:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_drm.c,v 1.2.2.2 2019/11/16 16:48:25 martin Exp $ */
+/* $NetBSD: rk_drm.c,v 1.2.2.3 2019/12/17 12:35:11 martin Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.2.2.2 2019/11/16 16:48:25 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.2.2.3 2019/12/17 12:35:11 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -401,7 +401,8 @@
 
        if (num_crtc == 0) {
                aprint_error_dev(sc->sc_dev, "no display interface ports configured\n");
-               return ENXIO;
+               error = ENXIO;
+               goto drmerr;
        }
 
        fbdev = kmem_zalloc(sizeof(*fbdev), KM_SLEEP);
@@ -410,7 +411,7 @@
 
        error = drm_fb_helper_init(ddev, &fbdev->helper, num_crtc, num_crtc);
        if (error)
-               goto drmerr;
+               goto allocerr;
 
        fbdev->helper.fb = kmem_zalloc(sizeof(struct rk_drm_framebuffer), KM_SLEEP);
 
@@ -426,9 +427,10 @@
 
        return 0;
 
+allocerr:
+       kmem_free(fbdev, sizeof(*fbdev));
 drmerr:
        drm_mode_config_cleanup(ddev);
-       kmem_free(fbdev, sizeof(*fbdev));
 
        return error;
 }
diff -r 75847bb17567 -r d97eb1fa408d sys/arch/arm/sunxi/sunxi_drm.c
--- a/sys/arch/arm/sunxi/sunxi_drm.c    Tue Dec 17 12:32:52 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_drm.c    Tue Dec 17 12:35:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_drm.c,v 1.7.6.2 2019/11/25 16:20:41 martin Exp $ */
+/* $NetBSD: sunxi_drm.c,v 1.7.6.3 2019/12/17 12:35:12 martin Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.7.6.2 2019/11/25 16:20:41 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.7.6.3 2019/12/17 12:35:12 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -440,7 +440,8 @@
 
        if (num_crtc == 0) {
                aprint_error_dev(sc->sc_dev, "no pipelines configured\n");
-               return ENXIO;
+               error = ENXIO;
+               goto drmerr;
        }
 
        fbdev = kmem_zalloc(sizeof(*fbdev), KM_SLEEP);
@@ -449,7 +450,7 @@
 
        error = drm_fb_helper_init(ddev, &fbdev->helper, num_crtc, num_crtc);
        if (error)
-               goto drmerr;
+               goto allocerr;
 
        fbdev->helper.fb = kmem_zalloc(sizeof(struct sunxi_drm_framebuffer), KM_SLEEP);
 
@@ -465,9 +466,10 @@
 
        return 0;
 
+allocerr:
+       kmem_free(fbdev, sizeof(*fbdev));
 drmerr:
        drm_mode_config_cleanup(ddev);
-       kmem_free(fbdev, sizeof(*fbdev));
 
        return error;
 }
diff -r 75847bb17567 -r d97eb1fa408d sys/arch/arm/ti/ti_lcdc.c
--- a/sys/arch/arm/ti/ti_lcdc.c Tue Dec 17 12:32:52 2019 +0000
+++ b/sys/arch/arm/ti/ti_lcdc.c Tue Dec 17 12:35:11 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_lcdc.c,v 1.3.2.2 2019/11/27 13:46:44 martin Exp $ */
+/* $NetBSD: ti_lcdc.c,v 1.3.2.3 2019/12/17 12:35:12 martin Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.3.2.2 2019/11/27 13:46:44 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.3.2.3 2019/12/17 12:35:12 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -622,12 +622,14 @@
        ep = fdt_endpoint_get_from_index(&sc->sc_ports, TILCDC_PORT_OUTPUT, 0);
        if (ep == NULL) {
                aprint_error_dev(sc->sc_dev, "couldn't find endpoint\n");
-               return ENXIO;
+               error = ENXIO;
+               goto drmerr;
        }
        error = fdt_endpoint_activate_direct(ep, true);
        if (error != 0) {
                aprint_error_dev(sc->sc_dev, "couldn't activate endpoint: %d\n", error);
-               return error;
+               error = ENXIO;
+               goto drmerr;
        }
 
        fbdev = kmem_zalloc(sizeof(*fbdev), KM_SLEEP);
@@ -636,7 +638,7 @@
 
        error = drm_fb_helper_init(ddev, &fbdev->helper, 1, 1);
        if (error)
-               goto drmerr;
+               goto allocerr;
 
        fbdev->helper.fb = kmem_zalloc(sizeof(struct tilcdc_framebuffer), KM_SLEEP);
 
@@ -648,9 +650,10 @@
 
        return 0;
 
+allocerr:
+       kmem_free(fbdev, sizeof(*fbdev));
 drmerr:
        drm_mode_config_cleanup(ddev);
-       kmem_free(fbdev, sizeof(*fbdev));
 
        return error;
 }



Home | Main Index | Thread Index | Old Index