]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
vgaarb: remove bogus checks
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 27 Nov 2015 04:24:14 +0000 (23:24 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 7 Dec 2015 02:17:17 +0000 (21:17 -0500)
neither ->release() nor ->poll() can be called unless ->open()
has succeeded on the same struct file, so checking for "has
open() failed" is pointless.  What's more, ->poll() doesn't
return -E... - it always returns a bitmap of POLL... values,
so the dead code in that one had been actively bogus.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/gpu/vga/vgaarb.c

index 3166e4bc4eb6daea9a9fcad4eb5fce4b62b1b418..de083aade1057adbc24a86b79349fc5114a4aa71 100644 (file)
@@ -1161,12 +1161,8 @@ done:
 
 static unsigned int vga_arb_fpoll(struct file *file, poll_table *wait)
 {
-       struct vga_arb_private *priv = file->private_data;
-
        pr_debug("%s\n", __func__);
 
-       if (priv == NULL)
-               return -ENODEV;
        poll_wait(file, &vga_wait_queue, wait);
        return POLLIN;
 }
@@ -1207,9 +1203,6 @@ static int vga_arb_release(struct inode *inode, struct file *file)
 
        pr_debug("%s\n", __func__);
 
-       if (priv == NULL)
-               return -ENODEV;
-
        spin_lock_irqsave(&vga_user_lock, flags);
        list_del(&priv->list);
        for (i = 0; i < MAX_USER_CARDS; i++) {