From: Daeseok Youn Date: Thu, 3 Jul 2014 10:12:01 +0000 (+0900) Subject: staging: dgnc: remove redundant null check for kfree() X-Git-Tag: v3.17-rc1~123^2~1120 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5b4af85eedea141026214fb40827a718633c5ccf;p=karo-tx-linux.git staging: dgnc: remove redundant null check for kfree() Signed-off-by: Daeseok Youn Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 4135cb0ed9f5..8081621cc9c0 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -417,10 +417,8 @@ int dgnc_tty_init(struct dgnc_board *brd) */ void dgnc_tty_post_uninit(void) { - if (dgnc_TmpWriteBuf) { - kfree(dgnc_TmpWriteBuf); - dgnc_TmpWriteBuf = NULL; - } + kfree(dgnc_TmpWriteBuf); + dgnc_TmpWriteBuf = NULL; } @@ -456,14 +454,10 @@ void dgnc_tty_uninit(struct dgnc_board *brd) brd->dgnc_Major_TransparentPrint_Registered = FALSE; } - if (brd->SerialDriver.ttys) { - kfree(brd->SerialDriver.ttys); - brd->SerialDriver.ttys = NULL; - } - if (brd->PrintDriver.ttys) { - kfree(brd->PrintDriver.ttys); - brd->PrintDriver.ttys = NULL; - } + kfree(brd->SerialDriver.ttys); + brd->SerialDriver.ttys = NULL; + kfree(brd->PrintDriver.ttys); + brd->PrintDriver.ttys = NULL; }