aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/interrupt.c
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2014-04-01 16:50:41 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 15:24:16 -0400
commit34ec43661fe8f1977dd0f05353302ae2ed10aabb (patch)
treea43273b676eb83e3bfcdc66ed6958caaa5de0469 /drivers/misc/mei/interrupt.c
parent5e6533a6f52f1a8283b2f818f5828be99a417dd6 (diff)
mei: ignore client writing state during cb completion
Ignore client writing state during cb completion to fix a memory leak. When moving cbs to the completion list we should not look at writing_state as this state can be already overwritten by next write, the fact that a cb is on the write waiting list means that it was already written to the HW and we can safely complete it. Same pays for wait in poll handler, we do not have to check the state wake is done after completion list processing. Cc: stable@vger.kernel.org Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/interrupt.c')
-rw-r--r--drivers/misc/mei/interrupt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index 29b5af8efb71..4e3cba6da3f5 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -455,8 +455,7 @@ int mei_irq_write_handler(struct mei_device *dev, struct mei_cl_cb *cmpl_list)
455 455
456 cl->status = 0; 456 cl->status = 0;
457 list_del(&cb->list); 457 list_del(&cb->list);
458 if (MEI_WRITING == cl->writing_state && 458 if (cb->fop_type == MEI_FOP_WRITE &&
459 cb->fop_type == MEI_FOP_WRITE &&
460 cl != &dev->iamthif_cl) { 459 cl != &dev->iamthif_cl) {
461 cl_dbg(dev, cl, "MEI WRITE COMPLETE\n"); 460 cl_dbg(dev, cl, "MEI WRITE COMPLETE\n");
462 cl->writing_state = MEI_WRITE_COMPLETE; 461 cl->writing_state = MEI_WRITE_COMPLETE;