diff mbox

mac80211: free sinfo on error path

Message ID 20160130143906.GD3462@mwanda (mailing list archive)
State Not Applicable
Delegated to: Johannes Berg
Headers show

Commit Message

Dan Carpenter Jan. 30, 2016, 2:39 p.m. UTC
There is a missing kfree(sinfo) on error in sta_info_insert_finish().

Fixes: 5fe74014172d ('mac80211: avoid excessive stack usage in sta_info')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Arend Van Spriel Jan. 30, 2016, 7:58 p.m. UTC | #1
On 30-01-16 15:39, Dan Carpenter wrote:
> There is a missing kfree(sinfo) on error in sta_info_insert_finish().
> 
> Fixes: 5fe74014172d ('mac80211: avoid excessive stack usage in sta_info')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Hi Dan,

A fix for this has already been posted [1]. Although your 'Fixes:' tag
is useful to have, I guess.

Regards,
Arend

[1]
http://mid.gmane.org/1454060944-11320-1-git-send-email-sudipm.mukherjee@gmail.com

> diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
> index 6c198e6..1502efb 100644
> --- a/net/mac80211/sta_info.c
> +++ b/net/mac80211/sta_info.c
> @@ -562,6 +562,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
>   out_err:
>  	mutex_unlock(&local->sta_mtx);
>  	rcu_read_lock();
> +	kfree(sinfo);
>  	return err;
>  }
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 6c198e6..1502efb 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -562,6 +562,7 @@  static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU)
  out_err:
 	mutex_unlock(&local->sta_mtx);
 	rcu_read_lock();
+	kfree(sinfo);
 	return err;
 }