adapted from a diff by Ted Bullock
dev = drm_attach_pci(&amdgpu_kms_driver, pa, 0, adev->primary,
self, &adev->ddev);
+ if (dev == NULL) {
+ printf("%s: drm attach failed\n", adev->self.dv_xname);
+ return;
+ }
adev->pdev = dev->pdev;
adev->is_fw_fb = adev->primary;
dev = drm_attach_pci(&driver, pa, 0, dev_priv->primary,
self, &dev_priv->drm);
+ if (dev == NULL) {
+ printf("%s: drm attach failed\n", dev_priv->sc_dev.dv_xname);
+ return;
+ }
id = drm_find_description(PCI_VENDOR(pa->pa_id),
PCI_PRODUCT(pa->pa_id), pciidlist);
dev = drm_attach_pci(&kms_driver, pa, is_agp, rdev->primary,
self, NULL);
+ if (dev == NULL) {
+ printf("%s: drm attach failed\n", rdev->self.dv_xname);
+ return;
+ }
rdev->ddev = dev;
rdev->pdev = dev->pdev;