summaryrefslogtreecommitdiffstats
path: root/drivers/tty/pty.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2021-05-13 23:18:33 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-20 16:32:59 +0200
commit4503b1c29db414de608e62d7c67753be8926b2fa (patch)
tree46c1efb6cb742f7c54294163996730715faf55da /drivers/tty/pty.c
parentcb1b206cff461d02ce373f54f1d215532cc5ac7c (diff)
downloadlinux-4503b1c29db414de608e62d7c67753be8926b2fa.tar.bz2
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>
Diffstat (limited to 'drivers/tty/pty.c')
-rw-r--r--drivers/tty/pty.c2
1 files changed, 1 insertions, 1 deletions
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;