diff options
| author | Imran Khan <kimran@codeaurora.org> | 2017-01-24 20:13:47 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-05-04 00:44:28 -0700 |
| commit | ea92fdb789adb5b2b31fefe00b6088fa64ca0dab (patch) | |
| tree | 104e67883d55bafc094d1314454f962ebeac5793 /drivers/base/firmware_class.c | |
| parent | 5d78c03af8ffb440d418cbc45ad0d68928354e48 (diff) | |
firmware_class: Avoid pending list corruption
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.
Change-Id: Id83afbd4416a82646f46b5015d983b9c63a2a613
Signed-off-by: Imran Khan <kimran@codeaurora.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
| -rw-r--r-- | drivers/base/firmware_class.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index f8112c356bc5..212ca2eee257 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -272,6 +272,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 |
