Removed redundant NULL checks before calling kfree() Signed-off-by: Vitaly Osipov <vitaly.osipov@xxxxxxxxx> --- 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 b1a39b2..e2c8fc7 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -451,20 +451,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; -- 1.7.9.5 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel