Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm ensure to call drm_mode_config_cleanup() when e...
details: https://anonhg.NetBSD.org/src/rev/fc795d86205c
branches: trunk
changeset: 847214:fc795d86205c
user: mrg <mrg%NetBSD.org@localhost>
date: Sun Dec 15 01:00:58 2019 +0000
description:
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 7385e72fa7d8 -r fc795d86205c sys/arch/arm/rockchip/rk_drm.c
--- a/sys/arch/arm/rockchip/rk_drm.c Sun Dec 15 00:49:00 2019 +0000
+++ b/sys/arch/arm/rockchip/rk_drm.c Sun Dec 15 01:00:58 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_drm.c,v 1.2 2019/11/14 20:39:46 jmcneill Exp $ */
+/* $NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg 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 2019/11/14 20:39:46 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.3 2019/12/15 01:00:58 mrg 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 7385e72fa7d8 -r fc795d86205c sys/arch/arm/sunxi/sunxi_drm.c
--- a/sys/arch/arm/sunxi/sunxi_drm.c Sun Dec 15 00:49:00 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_drm.c Sun Dec 15 01:00:58 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_drm.c,v 1.9 2019/11/24 12:21:14 jmcneill Exp $ */
+/* $NetBSD: sunxi_drm.c,v 1.10 2019/12/15 01:00:58 mrg 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.9 2019/11/24 12:21:14 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.10 2019/12/15 01:00:58 mrg 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 7385e72fa7d8 -r fc795d86205c sys/arch/arm/ti/ti_lcdc.c
--- a/sys/arch/arm/ti/ti_lcdc.c Sun Dec 15 00:49:00 2019 +0000
+++ b/sys/arch/arm/ti/ti_lcdc.c Sun Dec 15 01:00:58 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ti_lcdc.c,v 1.3 2019/11/04 09:38:38 jmcneill Exp $ */
+/* $NetBSD: ti_lcdc.c,v 1.4 2019/12/15 01:00:58 mrg 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 2019/11/04 09:38:38 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ti_lcdc.c,v 1.4 2019/12/15 01:00:58 mrg 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