aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_fops.c
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2011-10-31 10:28:57 -0400
committerDave Airlie <airlied@redhat.com>2011-11-11 06:14:47 -0500
commite08e96de986ceb2c6b683df0bd0c4ddd4f91dcfd (patch)
tree632e9e5dc117204b0f1e78f57be6abdc6f4750f3 /drivers/gpu/drm/drm_fops.c
parentd68752cf7bb92eafbbe6a0df0d0fab67e87523f6 (diff)
drm: Make the per-driver file_operations struct const
From fdf1fdebaa00f81de18c227f32f8074c8b352d50 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven <arjan@linux.intel.com> Date: Sun, 30 Oct 2011 19:06:07 -0700 Subject: [PATCH] drm: Make the per-driver file_operations struct const The DRM layer keeps a copy of struct file_operations inside its big driver struct... which prevents it from being consistent and static. For consistency (and the general security objective of having such things static), it's desirable to get this fixed. This patch splits out the file_operations field to its own struct, which is then "static const", and just stick a pointer to this into the driver struct, making it more consistent with how the rest of the kernel does this. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_fops.c')
-rw-r--r--drivers/gpu/drm/drm_fops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
index 4911e1d1dcf..c00cf154cc0 100644
--- a/drivers/gpu/drm/drm_fops.c
+++ b/drivers/gpu/drm/drm_fops.c
@@ -182,7 +182,7 @@ int drm_stub_open(struct inode *inode, struct file *filp)
182 goto out; 182 goto out;
183 183
184 old_fops = filp->f_op; 184 old_fops = filp->f_op;
185 filp->f_op = fops_get(&dev->driver->fops); 185 filp->f_op = fops_get(dev->driver->fops);
186 if (filp->f_op == NULL) { 186 if (filp->f_op == NULL) {
187 filp->f_op = old_fops; 187 filp->f_op = old_fops;
188 goto out; 188 goto out;