staging: dgnc: redundant NULL checks before kfree()

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>
This commit is contained in:
Vitaly Osipov 2014-04-27 00:59:17 +10:00 committed by Greg Kroah-Hartman
parent 3f2889621a
commit 36aa10aa01

View 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;