patch-2.4.6 linux/drivers/char/drm/radeon_bufs.c

Next file: linux/drivers/char/epca.c
Previous file: linux/drivers/char/drm/r128_drv.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/drivers/char/drm/radeon_bufs.c linux/drivers/char/drm/radeon_bufs.c
@@ -132,6 +132,11 @@
 		buf->dev_priv_size = sizeof(drm_radeon_buf_priv_t);
 		buf->dev_private   = drm_alloc(sizeof(drm_radeon_buf_priv_t),
 					       DRM_MEM_BUFS);
+                if (!buf->dev_private) {
+                        up(&dev->struct_sem);
+                        atomic_dec(&dev->buf_alloc);
+                        return -ENOMEM;
+                }
 		memset(buf->dev_private, 0, buf->dev_priv_size);
 
 #if DRM_DMA_HISTOGRAM

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)