Skip to content

Commit 48f5cde

Browse files
elfringgregkh
authored andcommitted
tty-hvsi_lib: Deletion of an unnecessary check before the function call "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>
1 parent a211b1a commit 48f5cde

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/tty/hvc/hvsi_lib.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,7 @@ void hvsilib_close(struct hvsi_priv *pv, struct hvc_struct *hp)
405405
hvsi_send_close(pv);
406406
}
407407

408-
if (pv->tty)
409-
tty_kref_put(pv->tty);
408+
tty_kref_put(pv->tty);
410409
pv->tty = NULL;
411410
}
412411

0 commit comments

Comments
 (0)