From 36aa10aa018c2ed5571ffd145f39d3fcf993cee0 Mon Sep 17 00:00:00 2001 From: Vitaly Osipov Date: Sun, 27 Apr 2014 00:59:17 +1000 Subject: [PATCH] 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 --- drivers/staging/dgnc/dgnc_driver.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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; -- 2.39.5