linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: reinette chatre <reinette.chatre@intel.com>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
	Martin Ettl <ettl.martin@gmx.de>
Subject: Re: [PATCH] iwlwifi: avoid memory leak in iwl_dbgfs_nvm_read
Date: Mon, 03 Aug 2009 12:08:12 -0700	[thread overview]
Message-ID: <1249326492.30019.4277.camel@rc-desk> (raw)
In-Reply-To: <1249325388-6496-1-git-send-email-linville@tuxdriver.com>

On Mon, 2009-08-03 at 11:49 -0700, John W. Linville wrote:
> Reported-by: Martin Ettl <ettl.martin@gmx.de>
> Signed-off-by: John W. Linville <linville@tuxdriver.com>
> ---
>  drivers/net/wireless/iwlwifi/iwl-debugfs.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
> index 11e08c0..6525e41 100644
> --- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
> +++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
> @@ -318,7 +318,8 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
>  	ptr = priv->eeprom;
>  	if (!ptr) {
>  		IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
> -		return -ENOMEM;
> +		ret = -ENOMEM;
> +		goto out;
>  	}
>  	pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n",
>  			(priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
> @@ -333,6 +334,8 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
>  	}
>  
>  	ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos);
> +
> +out:
>  	kfree(buf);
>  	return ret;
>  }

There was another patch also that was acked by Zhu Yi. See
http://thread.gmane.org/gmane.linux.kernel.wireless.general/37032


Reinette



  reply	other threads:[~2009-08-03 19:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-03 18:49 [PATCH] iwlwifi: avoid memory leak in iwl_dbgfs_nvm_read John W. Linville
2009-08-03 19:08 ` reinette chatre [this message]
2009-08-03 19:40   ` John W. Linville

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1249326492.30019.4277.camel@rc-desk \
    --to=reinette.chatre@intel.com \
    --cc=ettl.martin@gmx.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).