staging: dgnc: Need to check for NULL of ch

the "ch" from brd structure could be NULL, it need to
check for NULL.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Daeseok Youn 2016-05-09 11:47:34 +09:00 committed by Greg Kroah-Hartman
parent c246e2305a
commit bddb153108
1 changed files with 1 additions and 1 deletions

View File

@ -380,7 +380,7 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port)
unsigned long flags;
ch = brd->channels[port];
if (ch->magic != DGNC_CHANNEL_MAGIC)
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return;
/* Here we try to figure out what caused the interrupt to happen */