From: Tomas Winkler Date: Tue, 19 Jun 2012 06:13:36 +0000 (+0300) Subject: mei: mei_irq_thread_write_handler check for overflow X-Git-Tag: firefly_0821_release~3680^2~2354^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7d5e0e59542ac452585e3a33abcad6e26b4dec4a;p=firefly-linux-kernel-4.4.55.git mei: mei_irq_thread_write_handler check for overflow check for overflow when retrieving empty write slots Signed-off-by: Tomas Winkler Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c index 83e80bc08d77..8e4dd74b96e5 100644 --- a/drivers/misc/mei/interrupt.c +++ b/drivers/misc/mei/interrupt.c @@ -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");