aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_ioctl.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 09:07:16 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-07 09:07:16 -0800
commitd31d29540915f21d3f2bcfdd6d135fde328038a0 (patch)
tree43af1c34adff65dcb316ac8a82f3f05d6de9edad /drivers/char/drm/drm_ioctl.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq (diff)
parentdrm: add initial r500 drm support (diff)
downloadlinux-dev-d31d29540915f21d3f2bcfdd6d135fde328038a0.tar.xz
linux-dev-d31d29540915f21d3f2bcfdd6d135fde328038a0.zip
Merge branch 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (22 commits) drm: add initial r500 drm support radeon: setup the ring buffer fetcher to be less agressive. drm: fixup some of the ioctl function exit paths drm: the drm really should call pci_set_master.. i915: Add chipset id for Intel Integrated Graphics Device drm: cleanup DRM_DEBUG() parameters drm/i915: add support for E7221 chipset drm: don't cast a pointer to pointer of list_head mga_dma: return 'err' not just zero from mga_do_cleanup_dma() drm: add _DRM_DRIVER flag, and re-order unload. drm: enable udev node creation drm: Make DRM_IOCTL_GET_CLIENT return EINVAL when it can't find client #idx. drm: move drm_mem_init to proper place in startup sequence drm: call driver load function after initialising AGP drm: Fix ioc32 compat layer drm: fd.o bug #11895: Only add the AGP base to map offset if the caller didn't. i915: add suspend/resume support drm: update DRM sysfs support drm: Initialize the AGP structure's base address at init rather than enable. drm: move two function extern into the correct block ...
Diffstat (limited to 'drivers/char/drm/drm_ioctl.c')
-rw-r--r--drivers/char/drm/drm_ioctl.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/drivers/char/drm/drm_ioctl.c b/drivers/char/drm/drm_ioctl.c
index 3cbebf868e68..16829fb3089d 100644
--- a/drivers/char/drm/drm_ioctl.c
+++ b/drivers/char/drm/drm_ioctl.c
@@ -234,26 +234,23 @@ int drm_getclient(struct drm_device *dev, void *data,
idx = client->idx;
mutex_lock(&dev->struct_mutex);
-
- if (list_empty(&dev->filelist)) {
- mutex_unlock(&dev->struct_mutex);
- return -EINVAL;
- }
i = 0;
list_for_each_entry(pt, &dev->filelist, lhead) {
- if (i++ >= idx)
- break;
+ if (i++ >= idx) {
+ client->auth = pt->authenticated;
+ client->pid = pt->pid;
+ client->uid = pt->uid;
+ client->magic = pt->magic;
+ client->iocs = pt->ioctl_count;
+ mutex_unlock(&dev->struct_mutex);
+
+ return 0;
+ }
}
-
- client->auth = pt->authenticated;
- client->pid = pt->pid;
- client->uid = pt->uid;
- client->magic = pt->magic;
- client->iocs = pt->ioctl_count;
mutex_unlock(&dev->struct_mutex);
- return 0;
+ return -EINVAL;
}
/**