Skip to content

Commit

Permalink
vgaarb: fix "target=default" passing
Browse files Browse the repository at this point in the history
Commit 77c1ff3 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>
  • Loading branch information
Kyle McMartin authored and Dave Airlie committed Feb 19, 2010
1 parent 6b15835 commit 2cc9116
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/vga/vgaarb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2cc9116

Please sign in to comment.