staging: dgnc: don't forget to check if ->channels[i] is NULL in dgnc_tty_uninit()
authorGiedrius Statkevičius <giedrius.statkevicius@gmail.com>
Thu, 9 Apr 2015 23:42:30 +0000 (02:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 May 2015 07:24:00 +0000 (09:24 +0200)
commitce2927e9a3b325b92acfeab66632f9a38d572722
tree7bb540e7a72113dbdd23f491e8afb1a37eedba33
parentfa52d96c3ea110acb77e51c856ec0b54606cc17e
staging: dgnc: don't forget to check if ->channels[i] is NULL in dgnc_tty_uninit()

Add a check if ->channels[i] is NULL because a NULL pointer may be dereferenced
in case one of the allocations failed

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/dgnc/dgnc_tty.c