mei: mei_irq_thread_write_handler check for overflow

check for overflow when retrieving empty write slots

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomas Winkler 2012-06-19 09:13:36 +03:00 committed by Greg Kroah-Hartman
parent 169d1338ed
commit 7d5e0e5954

View File

@ -1204,6 +1204,9 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list,
return 0;
}
*slots = mei_count_empty_write_slots(dev);
if (*slots <= 0)
return -EMSGSIZE;
/* complete all waiting for write CB */
dev_dbg(&dev->pdev->dev, "complete all waiting for write cb.\n");