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

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
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -448,19 +448,14 @@ 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]);
			brd->channels[i] = NULL;
		}
	}

	if (brd->flipbuf)
	kfree(brd->flipbuf);

	dgnc_Board[brd->boardnum] = NULL;