Skip to content

Commit

Permalink
tty-hvsi_lib: Deletion of an unnecessary check before the function ca…
Browse files Browse the repository at this point in the history
…ll "tty_kref_put"

The tty_kref_put() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Markus Elfring authored and Greg Kroah-Hartman committed Nov 27, 2014
1 parent a211b1a commit 48f5cde
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/tty/hvc/hvsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,7 @@ void hvsilib_close(struct hvsi_priv *pv, struct hvc_struct *hp)
hvsi_send_close(pv);
}

if (pv->tty)
tty_kref_put(pv->tty);
tty_kref_put(pv->tty);
pv->tty = NULL;
}

Expand Down

0 comments on commit 48f5cde

Please sign in to comment.