Use M_WAITOK when allocating driver memory

We don't explicity check for error here and M_WAITOK will just put the
process to sleep waiting on resources to become available.

Suggested by jhb@

Approved by:	jhb (mentor)
This commit is contained in:
Robert Noland 2008-10-04 14:48:40 +00:00
parent 4d3ad1c1a6
commit e0b8582173
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=183604
8 changed files with 24 additions and 8 deletions

View File

@ -114,7 +114,9 @@ i915_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
i915_configure(dev);
return drm_attach(nbdev, i915_pciidlist);

View File

@ -88,7 +88,9 @@ mach64_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
mach64_configure(dev);
return drm_attach(nbdev, mach64_pciidlist);

View File

@ -132,7 +132,9 @@ mga_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
mga_configure(dev);
return drm_attach(nbdev, mga_pciidlist);

View File

@ -87,7 +87,9 @@ r128_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
r128_configure(dev);
return drm_attach(nbdev, r128_pciidlist);

View File

@ -92,7 +92,9 @@ radeon_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
radeon_configure(dev);
return drm_attach(nbdev, radeon_pciidlist);

View File

@ -78,7 +78,9 @@ savage_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
savage_configure(dev);
return drm_attach(nbdev, savage_pciidlist);

View File

@ -72,7 +72,9 @@ sis_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
sis_configure(dev);
return drm_attach(nbdev, sis_pciidlist);

View File

@ -74,7 +74,9 @@ tdfx_attach(device_t nbdev)
bzero(dev, sizeof(struct drm_device));
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM, M_NOWAIT | M_ZERO);
dev->driver = malloc(sizeof(struct drm_driver_info), M_DRM,
M_WAITOK | M_ZERO);
tdfx_configure(dev);
return drm_attach(nbdev, tdfx_pciidlist);