Commit cc6289fa authored by Eli Billauer's avatar Eli Billauer Committed by Greg Kroah-Hartman

staging: xillybus: Add sanity check in interrupt handler

Data arriving from the hardware is verified prior to its use. The lack of
this check has never been reported to cause a problem, but it's necessary
nevertheless.
Signed-off-by: default avatarEli Billauer <eli.billauer@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f765d9f
......@@ -267,6 +267,12 @@ irqreturn_t xillybus_isr(int irq, void *data)
break;
case XILLYMSG_OPCODE_FIFOEOF:
if ((msg_channel > ep->num_channels) ||
(msg_channel == 0) || (!msg_dir) ||
!ep->channels[msg_channel]->num_wr_buffers) {
malformed_message(ep, &buf[i]);
break;
}
channel = ep->channels[msg_channel];
spin_lock(&channel->wr_spinlock);
channel->wr_eof = msg_bufno;
......
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