summaryrefslogtreecommitdiff
path: root/shared/via_dma.c
diff options
context:
space:
mode:
authorThomas Hellstrom <unichrome@shipmail.org>2004-11-03 13:37:37 +0000
committerThomas Hellstrom <unichrome@shipmail.org>2004-11-03 13:37:37 +0000
commitf08a01c0e21431e1b7990584ce2f61f0e711c093 (patch)
treeb3a19e50620295ce183799808908f647a52750be /shared/via_dma.c
parent9409d8231c3be346ce7148275ce0ee86ec171716 (diff)
Fixed bug in via_dma.c. The code didn't check that the lock was held by the
caller. Just that it was held.
Diffstat (limited to 'shared/via_dma.c')
-rw-r--r--shared/via_dma.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/shared/via_dma.c b/shared/via_dma.c
index d986b9df..39613bc5 100644
--- a/shared/via_dma.c
+++ b/shared/via_dma.c
@@ -249,10 +249,7 @@ int via_flush_ioctl(DRM_IOCTL_ARGS)
{
DRM_DEVICE;
- if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
- DRM_ERROR("via_flush_ioctl called without lock held\n");
- return DRM_ERR(EINVAL);
- }
+ LOCK_TEST_WITH_RETURN( dev, filp );
return via_quiescent(dev);
}
@@ -263,16 +260,13 @@ int via_cmdbuffer(DRM_IOCTL_ARGS)
drm_via_cmdbuffer_t cmdbuf;
int ret;
+ LOCK_TEST_WITH_RETURN( dev, filp );
+
DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data,
sizeof(cmdbuf));
DRM_DEBUG("via cmdbuffer, buf %p size %lu\n", cmdbuf.buf, cmdbuf.size);
- if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
- DRM_ERROR("via_cmdbuffer called without lock held\n");
- return DRM_ERR(EINVAL);
- }
-
ret = via_dispatch_cmdbuffer(dev, &cmdbuf);
if (ret) {
return ret;
@@ -340,17 +334,14 @@ int via_pci_cmdbuffer(DRM_IOCTL_ARGS)
drm_via_cmdbuffer_t cmdbuf;
int ret;
+ LOCK_TEST_WITH_RETURN( dev, filp );
+
DRM_COPY_FROM_USER_IOCTL(cmdbuf, (drm_via_cmdbuffer_t *) data,
sizeof(cmdbuf));
DRM_DEBUG("via_pci_cmdbuffer, buf %p size %lu\n", cmdbuf.buf,
cmdbuf.size);
- if (!_DRM_LOCK_IS_HELD(dev->lock.hw_lock->lock)) {
- DRM_ERROR("via_pci_cmdbuffer called without lock held\n");
- return DRM_ERR(EINVAL);
- }
-
ret = via_dispatch_pci_cmdbuffer(dev, &cmdbuf);
if (ret) {
return ret;