From: Vitaly Osipov Date: Sat, 26 Apr 2014 14:59:17 +0000 (+1000) Subject: staging: dgnc: redundant NULL checks before kfree() X-Git-Tag: firefly_0821_release~176^2~3465^2~39^2~906 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=36aa10aa018c2ed5571ffd145f39d3fcf993cee0;p=firefly-linux-kernel-4.4.55.git staging: dgnc: redundant NULL checks before kfree() Removed redundant NULL checks before calling kfree() Signed-off-by: Vitaly Osipov Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 031e13e1f51a..5af8300dfb0d 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -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;