[ 3.5.y.z extended stable ] Patch "iwlwifi: fix freeing uninitialized pointer" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Tue May 7 10:33:25 UTC 2013
This is a note to let you know that I have just added a patch titled
iwlwifi: fix freeing uninitialized pointer
to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From ac6361a7afcee159129dbe7d4e87fb83df4fa51e Mon Sep 17 00:00:00 2001
From: Stanislaw Gruszka <sgruszka at redhat.com>
Date: Tue, 16 Apr 2013 15:38:29 +0200
Subject: [PATCH] iwlwifi: fix freeing uninitialized pointer
commit 3309ccf7fcebceef540ebe90c65d2f94d745a45b upstream.
If on iwl_dump_nic_event_log() error occurs before that function
initialize buf, we process uninitiated pointer in
iwl_dbgfs_log_event_read() and can hit "BUG at mm/slub.c:3409"
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=951241
Reported-by: ian.odette at eprize.com
Signed-off-by: Stanislaw Gruszka <sgruszka at redhat.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach at intel.com>
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
[ luis: backport to 3.5:
- file rename: dvm/debugfs.c -> iwl-debugfs.c ]
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 5000690..ba376ec 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -2248,15 +2248,15 @@ static ssize_t iwl_dbgfs_log_event_read(struct file *file,
size_t count, loff_t *ppos)
{
struct iwl_priv *priv = file->private_data;
- char *buf;
- int pos = 0;
- ssize_t ret = -ENOMEM;
+ char *buf = NULL;
+ ssize_t ret;
- ret = pos = iwl_dump_nic_event_log(priv, true, &buf, true);
- if (buf) {
- ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
- kfree(buf);
- }
+ ret = iwl_dump_nic_event_log(priv, true, &buf, true);
+ if (ret < 0)
+ goto err;
+ ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret);
+err:
+ kfree(buf);
return ret;
}
--
1.8.1.2
More information about the kernel-team
mailing list