Commit 36aa10aa authored by Vitaly Osipov's avatar Vitaly Osipov Committed by Greg Kroah-Hartman

staging: dgnc: redundant NULL checks before kfree()

Removed redundant NULL checks before calling kfree()
Signed-off-by: default avatarVitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3f288962
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment