linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: avoid memory leak in iwl_dbgfs_nvm_read
@ 2009-08-03 18:49 John W. Linville
  2009-08-03 19:08 ` reinette chatre
  0 siblings, 1 reply; 3+ messages in thread
From: John W. Linville @ 2009-08-03 18:49 UTC (permalink / raw)
  To: linux-wireless; +Cc: Martin Ettl, John W. Linville

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;
 }
-- 
1.6.2.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iwlwifi: avoid memory leak in iwl_dbgfs_nvm_read
  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
  2009-08-03 19:40   ` John W. Linville
  0 siblings, 1 reply; 3+ messages in thread
From: reinette chatre @ 2009-08-03 19:08 UTC (permalink / raw)
  To: John W. Linville; +Cc: linux-wireless, Martin Ettl

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iwlwifi: avoid memory leak in iwl_dbgfs_nvm_read
  2009-08-03 19:08 ` reinette chatre
@ 2009-08-03 19:40   ` John W. Linville
  0 siblings, 0 replies; 3+ messages in thread
From: John W. Linville @ 2009-08-03 19:40 UTC (permalink / raw)
  To: reinette chatre; +Cc: linux-wireless, Martin Ettl

On Mon, Aug 03, 2009 at 12:08:12PM -0700, reinette chatre wrote:
> 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

Yes, I see that now -- perhaps Martin will take-up Julia's habit of
posting patches himself... :-)

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.
			¡Viva Honduras Libre!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-03 19:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2009-08-03 19:40   ` John W. Linville

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).