Re: [PATCH 1/2] mac80211-hwsim: Factor out netlink attribute appending

2014-11-12 Thread Patrik Flykt
On Mon, 2014-11-10 at 10:32 +0100, Johannes Berg wrote:
 You seem to have lost the nlmsg_free() in error cases.

Indeed. Will fix.

Patrik

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


Re: [PATCH 1/2] mac80211-hwsim: Factor out netlink attribute appending

2014-11-10 Thread Johannes Berg
On Fri, 2014-11-07 at 10:21 +0200, Patrik Flykt wrote:

 -error:
 - nlmsg_free(skb);
 - return NULL;
 + return 0;
  }
  
 -static void hswim_mcast_new_radio(int id, struct genl_info *info,
 +static void hwsim_mcast_new_radio(int id, struct genl_info *info,
 struct hwsim_new_radio_params *param)
  {
   struct sk_buff *mcast_skb;
 + void *data;
  
 - mcast_skb = build_radio_msg(HWSIM_CMD_NEW_RADIO, id, param);
 + mcast_skb = genlmsg_new(GENLMSG_DEFAULT_SIZE, GFP_KERNEL);
   if (!mcast_skb)
   return;
  
 + data = genlmsg_put(mcast_skb, 0, 0, hwsim_genl_family, 0,
 +HWSIM_CMD_NEW_RADIO);
 + if (!data)
 + goto out_err;
 +
 + if (append_radio_msg(mcast_skb, id, param)  0)
 + goto out_err;
 +
 + if (genlmsg_end(mcast_skb, data))
 + goto out_err;
 +
   hwsim_mcast_config_msg(mcast_skb, info);
 + return;
 +
 +out_err:
 + genlmsg_cancel(mcast_skb, data);
  }

You seem to have lost the nlmsg_free() in error cases.

johannes

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