diff options
author | Lidza Louina <lidza.louina@gmail.com> | 2013-09-23 22:47:15 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-25 23:18:10 (GMT) |
commit | fcfeef6c5144c3759f84edafd24eb4e74343c820 (patch) | |
tree | 7ae3d7f57e0e241c9097777edd3c9dd6288857d3 | |
parent | 913b6f8e0dccadb1189e945d7438047d59efe785 (diff) | |
download | linux-fsl-qoriq-fcfeef6c5144c3759f84edafd24eb4e74343c820.tar.xz |
staging: dgap: tty.c: removes smatch warnings "redundant null check"
This patch removes these smatch warnings:
redundant null check on dgap_TmpWriteBuf calling kfree()
redundant null check on brd->SerialDriver->ttys calling kfree()
redundant null check on brd->PrintDriver->ttys calling kfree()
The code checked to see if these variables are null
before freeing. This check isn't needed.
Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/staging/dgap/dgap_tty.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/staging/dgap/dgap_tty.c b/drivers/staging/dgap/dgap_tty.c index 7f909b8..924e2bf 100644 --- a/drivers/staging/dgap/dgap_tty.c +++ b/drivers/staging/dgap/dgap_tty.c @@ -497,10 +497,8 @@ int dgap_tty_init(struct board_t *brd) */ void dgap_tty_post_uninit(void) { - if (dgap_TmpWriteBuf) { - kfree(dgap_TmpWriteBuf); - dgap_TmpWriteBuf = NULL; - } + kfree(dgap_TmpWriteBuf); + dgap_TmpWriteBuf = NULL; } @@ -522,10 +520,8 @@ void dgap_tty_uninit(struct board_t *brd) tty_unregister_device(brd->SerialDriver, i); } tty_unregister_driver(brd->SerialDriver); - if (brd->SerialDriver->ttys) { - kfree(brd->SerialDriver->ttys); - brd->SerialDriver->ttys = NULL; - } + kfree(brd->SerialDriver->ttys); + brd->SerialDriver->ttys = NULL; put_tty_driver(brd->SerialDriver); brd->dgap_Major_Serial_Registered = FALSE; } @@ -538,10 +534,8 @@ void dgap_tty_uninit(struct board_t *brd) tty_unregister_device(brd->PrintDriver, i); } tty_unregister_driver(brd->PrintDriver); - if (brd->PrintDriver->ttys) { - kfree(brd->PrintDriver->ttys); - brd->PrintDriver->ttys = NULL; - } + kfree(brd->PrintDriver->ttys); + brd->PrintDriver->ttys = NULL; put_tty_driver(brd->PrintDriver); brd->dgap_Major_TransparentPrint_Registered = FALSE; } |