Check some return vals, fixes a couple of oopses.
parent
18bba3fa29
commit
e9194dd1b0
|
@ -403,6 +403,10 @@ static int nouveau_fifo_alloc(drm_device_t* dev,drm_nouveau_fifo_alloc_t* init,
|
||||||
NV_DMA_ACCESS_RO,
|
NV_DMA_ACCESS_RO,
|
||||||
NV_DMA_TARGET_VIDMEM);
|
NV_DMA_TARGET_VIDMEM);
|
||||||
}
|
}
|
||||||
|
if (!cb_obj) {
|
||||||
|
DRM_ERROR("unable to alloc object for command buffer\n");
|
||||||
|
return DRM_ERR(EINVAL);
|
||||||
|
}
|
||||||
dev_priv->fifos[i].cmdbuf_obj = cb_obj;
|
dev_priv->fifos[i].cmdbuf_obj = cb_obj;
|
||||||
|
|
||||||
/* that fifo is used */
|
/* that fifo is used */
|
||||||
|
|
|
@ -523,6 +523,8 @@ int nouveau_ioctl_object_init(DRM_IOCTL_ARGS)
|
||||||
int fifo;
|
int fifo;
|
||||||
|
|
||||||
fifo = nouveau_fifo_id_get(dev, filp);
|
fifo = nouveau_fifo_id_get(dev, filp);
|
||||||
|
if (fifo == -1)
|
||||||
|
return DRM_ERR(EINVAL);
|
||||||
|
|
||||||
DRM_COPY_FROM_USER_IOCTL(init, (drm_nouveau_object_init_t __user *)
|
DRM_COPY_FROM_USER_IOCTL(init, (drm_nouveau_object_init_t __user *)
|
||||||
data, sizeof(init));
|
data, sizeof(init));
|
||||||
|
@ -577,6 +579,8 @@ int nouveau_ioctl_dma_object_init(DRM_IOCTL_ARGS)
|
||||||
int fifo;
|
int fifo;
|
||||||
|
|
||||||
fifo = nouveau_fifo_id_get(dev, filp);
|
fifo = nouveau_fifo_id_get(dev, filp);
|
||||||
|
if (fifo == -1)
|
||||||
|
return DRM_ERR(EINVAL);
|
||||||
|
|
||||||
DRM_COPY_FROM_USER_IOCTL(init, (drm_nouveau_dma_object_init_t __user *)
|
DRM_COPY_FROM_USER_IOCTL(init, (drm_nouveau_dma_object_init_t __user *)
|
||||||
data, sizeof(init));
|
data, sizeof(init));
|
||||||
|
|
Loading…
Reference in New Issue