nl80211: Allocate array of pointers for nla_parse
Subsystems (3)
PATCH 1/1 nl80211: Allocate array of pointers for nla_parse
The code allocates an array of struct nlattr, but it seems to me that it should allocate an array of pointers.
Signed-off-by Marcus Better <[email protected]>
net/wireless/nl80211.c +1 -1
@@ -843,7 +843,7 @@ static int nl80211_initiate_scan(struct sk_buff *skb, struct genl_info *info) channels =kmalloc (count *sizeof (struct scan_channel ),GFP_KERNEL ); - tb =kmalloc ((NL80211_ATTR_MAX +1 ) *sizeof (struct nlattr ), + tb =kmalloc ((NL80211_ATTR_MAX +1 ) *sizeof (struct nlattr *),GFP_KERNEL ); count =0 ;
Quoted 3 lines · Marcus Better
The code allocates an array of struct nlattr, but it seems to me that it should allocate an array of pointers.
Signed-off-by Marcus Better <[email protected]>
Yup.
Acked-by Johannes Berg <[email protected]>
Quoted 11 lines
net/wireless/nl80211.c +1
-1@@ -843,7 +843,7 @@ static int nl80211_initiate_scan(struct sk_buff *skb, struct genl_info *info) channels =kmalloc (count *sizeof (struct scan_channel ),GFP_KERNEL ); - tb =kmalloc ((NL80211_ATTR_MAX +1 ) *sizeof (struct nlattr ), + tb =kmalloc ((NL80211_ATTR_MAX +1 ) *sizeof (struct nlattr *),GFP_KERNEL ); count =0 ;