lkml.org 
[lkml]   [2017]   [Jan]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] firmware_class: Avoid pending list corruption
Date
Remove firmware buffer from pending list when it is freed.
Once the buffer is free kmalloc can allocate the same slab
object for some other user but as the buffer is still there
in the pending list, we end up with multiple users of the
same slab object using it in different contexts.

Signed-off-by: Imran Khan <kimran@codeaurora.org>
---
drivers/base/firmware_class.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 4497d26..d09c1aa 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -339,6 +339,9 @@ static void __fw_free_buf(struct kref *ref)
(unsigned int)buf->size);

list_del(&buf->list);
+#ifdef CONFIG_FW_LOADER_USER_HELPER
+ list_del(&buf->pending_list);
+#endif
spin_unlock(&fwc->lock);

#ifdef CONFIG_FW_LOADER_USER_HELPER
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
\
 
 \ /
  Last update: 2017-01-25 13:47    [W:0.035 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site