From c3ebd5edbcc78d8b41873002780c56d0542ff914 Mon Sep 17 00:00:00 2001 From: Aleksandr Rybalko Date: Thu, 12 Dec 2013 14:49:26 +0000 Subject: [PATCH] Do not try to probe/attach if attempt to add fbd child are failed. Sponsored by: The FreeBSD Foundation --- sys/dev/drm2/drm_fb_helper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/dev/drm2/drm_fb_helper.c b/sys/dev/drm2/drm_fb_helper.c index 90a00987a1b3..d797502a7a21 100644 --- a/sys/dev/drm2/drm_fb_helper.c +++ b/sys/dev/drm2/drm_fb_helper.c @@ -1043,7 +1043,10 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, kdev = fb_helper->dev->device; fbd = device_add_child(kdev, "fbd", device_get_unit(kdev)); - ret = device_probe_and_attach(fbd); + if (fbd != NULL) + ret = device_probe_and_attach(fbd); + else + ret = ENODEV; #ifdef DEV_VT if (ret != 0) DRM_ERROR("Failed to attach fbd device: %d\n", ret);