summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorKyle McMartin <kyle@redhat.com>2010-02-16 16:18:37 -0500
committerDave Airlie <airlied@redhat.com>2010-02-20 07:28:04 +1000
commit2cc9116c2b37c525965d76a3e6def38913259427 (patch)
tree16d5540bae7da373a52efd179c094f5cfc80c472 /drivers/gpu
parent6b15835282f9c6a023e2625455bfdb822bb9cc64 (diff)
vgaarb: fix "target=default" passing
Commit 77c1ff3982c6b36961725dd19e872a1c07df7f3b fixed the userspace pointer dereference, but introduced another bug pointed out by Eugene Teo in RH bug #564264. Instead of comparing the point we were at in the string, we instead compared the beginning of the string to "default". Signed-off-by: Kyle McMartin <kyle@redhat.com> Reported-by: Eugene Teo <eteo@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/vga/vgaarb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/vga/vgaarb.c b/drivers/gpu/vga/vgaarb.c
index 24b56dc5459..2f6cf69ecb3 100644
--- a/drivers/gpu/vga/vgaarb.c
+++ b/drivers/gpu/vga/vgaarb.c
@@ -961,7 +961,7 @@ static ssize_t vga_arb_write(struct file *file, const char __user * buf,
remaining -= 7;
pr_devel("client 0x%p called 'target'\n", priv);
/* if target is default */
- if (!strncmp(kbuf, "default", 7))
+ if (!strncmp(curr_pos, "default", 7))
pdev = pci_dev_get(vga_default_device());
else {
if (!vga_pci_str_to_vars(curr_pos, remaining,