Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: pty: remove redundant initialization of variable fd

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>

authored by

Colin Ian King and committed by
Greg Kroah-Hartman
4503b1c2 cb1b206c

+1 -1
+1 -1
drivers/tty/pty.c
··· 611 611 */ 612 612 int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags) 613 613 { 614 - int fd = -1; 614 + int fd; 615 615 struct file *filp; 616 616 int retval = -EINVAL; 617 617 struct path path;