OSDN Git Service

staging: dgnc: remove redundant null check for kfree()
authorDaeseok Youn <daeseok.youn@gmail.com>
Thu, 3 Jul 2014 10:12:01 +0000 (19:12 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Jul 2014 19:07:30 +0000 (12:07 -0700)
Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c

index 4135cb0..8081621 100644 (file)
@@ -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;
 }