staging: dgap: driver.c: removes smatch warning "redundant null check"
authorLidza Louina <lidza.louina@gmail.com>
Mon, 23 Sep 2013 22:47:12 +0000 (18:47 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 25 Sep 2013 23:09:24 +0000 (16:09 -0700)
This patch removes these smatch warnings from dgap_driver.c:

redundant null check on dgap_config_buf calling kfree()
redundant null check on brd->flipbuf calling kfree()
redundant null check on brd->flipflagbuf calling kfree()

Signed-off-by: Lidza Louina <lidza.louina@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgap/dgap_driver.c

index a3fa6a80b3aeaed1c104914bcd0ab9f6d5e14299..4c1515ee56e58a9e2d00f7385cb3494ac1a392bb 100644 (file)
@@ -416,8 +416,7 @@ void dgap_cleanup_module(void)
                unregister_chrdev(DIGI_DGAP_MAJOR, "dgap");
        }
 
-       if (dgap_config_buf)
-               kfree(dgap_config_buf);
+       kfree(dgap_config_buf);
 
        for (i = 0; i < dgap_NumBoards; ++i) {
                dgap_remove_ports_sysfiles(dgap_Board[i]);
@@ -484,10 +483,8 @@ static void dgap_cleanup_board(struct board_t *brd)
                }
        }
 
-       if (brd->flipbuf)
-               kfree(brd->flipbuf);
-       if (brd->flipflagbuf)
-               kfree(brd->flipflagbuf);
+       kfree(brd->flipbuf);
+       kfree(brd->flipflagbuf);
 
        dgap_Board[brd->boardnum] = NULL;