From 4503b1c29db414de608e62d7c67753be8926b2fa Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 13 May 2021 23:18:33 +0100 Subject: [PATCH] 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 Signed-off-by: Colin Ian King Addresses-Coverity: ("Unused value") Link: https://lore.kernel.org/r/20210513221833.137672-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/pty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c index 5ada7e9381eb..73c43f72b4c9 100644 --- a/drivers/tty/pty.c +++ b/drivers/tty/pty.c @@ -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;