tty: pty: remove redundant initialization of variable fd
authorColin Ian King <colin.king@canonical.com>
Thu, 13 May 2021 22:18:33 +0000 (23:18 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 May 2021 14:32:59 +0000 (16:32 +0200)
The variable fd is being initialized with a value that is never
read, it is being updated later on. The assignment is redundant and
can be removed.

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Addresses-Coverity: ("Unused value")
Link: https://lore.kernel.org/r/20210513221833.137672-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/pty.c

index 5ada7e9..73c43f7 100644 (file)
@@ -611,7 +611,7 @@ static struct cdev ptmx_cdev;
  */
 int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags)
 {
-       int fd = -1;
+       int fd;
        struct file *filp;
        int retval = -EINVAL;
        struct path path;