提交 2cc9116c 编写于 作者: K Kyle McMartin 提交者: Dave Airlie

vgaarb: fix "target=default" passing

Commit 77c1ff39 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: NKyle McMartin <kyle@redhat.com>
Reported-by: NEugene Teo <eteo@redhat.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 6b158352
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册