]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: dgnc: redundant NULL checks before kfree()
authorVitaly Osipov <vitaly.osipov@gmail.com>
Sat, 26 Apr 2014 14:59:17 +0000 (00:59 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 May 2014 20:46:00 +0000 (13:46 -0700)
Removed redundant NULL checks before calling kfree()

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_driver.c

index 031e13e1f51a45ee2e5f5c2980e9fb6f3d5ec347..5af8300dfb0d984d9be53d393aec41dc03fddf1a 100644 (file)
@@ -448,20 +448,15 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
        /* Free all allocated channels structs */
        for (i = 0; i < MAXPORTS ; i++) {
                if (brd->channels[i]) {
-                       if (brd->channels[i]->ch_rqueue)
-                               kfree(brd->channels[i]->ch_rqueue);
-                       if (brd->channels[i]->ch_equeue)
-                               kfree(brd->channels[i]->ch_equeue);
-                       if (brd->channels[i]->ch_wqueue)
-                               kfree(brd->channels[i]->ch_wqueue);
-
+                       kfree(brd->channels[i]->ch_rqueue);
+                       kfree(brd->channels[i]->ch_equeue);
+                       kfree(brd->channels[i]->ch_wqueue);
                        kfree(brd->channels[i]);
                        brd->channels[i] = NULL;
                }
        }
 
-       if (brd->flipbuf)
-               kfree(brd->flipbuf);
+       kfree(brd->flipbuf);
 
        dgnc_Board[brd->boardnum] = NULL;