From: John W. Linville Date: Wed, 18 Apr 2012 18:17:13 +0000 (-0400) Subject: Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=59ef43e681d103a51c3727dad0315e093f07ec61;p=linux-beck.git Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-testmode.c include/net/nfc/nfc.h net/nfc/netlink.c net/wireless/nl80211.c --- 59ef43e681d103a51c3727dad0315e093f07ec61 diff --cc drivers/net/wireless/iwlwifi/iwl-testmode.c index f31a0629c6c6,c8e89cac7ea3..bb275098bb10 --- a/drivers/net/wireless/iwlwifi/iwl-testmode.c +++ b/drivers/net/wireless/iwlwifi/iwl-testmode.c @@@ -543,12 -539,11 +543,12 @@@ static int iwl_testmode_driver(struct i IWL_ERR(priv, "Memory allocation fail\n"); return -ENOMEM; } - NLA_PUT_U32(skb, IWL_TM_ATTR_COMMAND, - IWL_TM_CMD_DEV2APP_EEPROM_RSP); - NLA_PUT(skb, IWL_TM_ATTR_EEPROM, - cfg(priv)->base_params->eeprom_size, - priv->eeprom); + if (nla_put_u32(skb, IWL_TM_ATTR_COMMAND, + IWL_TM_CMD_DEV2APP_EEPROM_RSP) || + nla_put(skb, IWL_TM_ATTR_EEPROM, + cfg(priv)->base_params->eeprom_size, - priv->shrd->eeprom)) ++ priv->eeprom)) + goto nla_put_failure; status = cfg80211_testmode_reply(skb); if (status < 0) IWL_ERR(priv, "Error sending msg : %d\n", diff --cc include/net/nfc/nfc.h index 79955a238ccc,313d00fac276..9a2505a5b8de --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h @@@ -86,7 -90,8 +90,8 @@@ struct nfc_genl_data }; struct nfc_dev { - unsigned idx; + unsigned int idx; + u32 target_next_idx; struct nfc_target *targets; int n_targets; int targets_generation; diff --cc net/nfc/netlink.c index 8937664674fa,ebdb605f8dbd..f1829f6ae9c5 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c @@@ -188,6 -183,36 +188,37 @@@ free_msg return -EMSGSIZE; } + int nfc_genl_target_lost(struct nfc_dev *dev, u32 target_idx) + { + struct sk_buff *msg; + void *hdr; + + msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); + if (!msg) + return -ENOMEM; + + hdr = genlmsg_put(msg, 0, 0, &nfc_genl_family, 0, + NFC_EVENT_TARGET_LOST); + if (!hdr) + goto free_msg; + - NLA_PUT_STRING(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)); - NLA_PUT_U32(msg, NFC_ATTR_TARGET_INDEX, target_idx); ++ if (nla_put_string(msg, NFC_ATTR_DEVICE_NAME, nfc_device_name(dev)) || ++ nla_put_u32(msg, NFC_ATTR_TARGET_INDEX, target_idx)) ++ goto nla_put_failure; + + genlmsg_end(msg, hdr); + + genlmsg_multicast(msg, 0, nfc_genl_event_mcgrp.id, GFP_KERNEL); + + return 0; + + nla_put_failure: + genlmsg_cancel(msg, hdr); + free_msg: + nlmsg_free(msg); + return -EMSGSIZE; + } + int nfc_genl_device_added(struct nfc_dev *dev) { struct sk_buff *msg; diff --cc net/wireless/nl80211.c index ff1a6c7fbe33,bcf6f70e518d..83d71d6b63a4 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@@ -1530,16 -1492,28 +1530,29 @@@ static int nl80211_send_iface(struct sk if (!hdr) return -1; - NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, dev->ifindex); - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); - NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name); - NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype); - - NLA_PUT_U32(msg, NL80211_ATTR_GENERATION, - rdev->devlist_generation ^ - (cfg80211_rdev_list_generation << 2)); + if (nla_put_u32(msg, NL80211_ATTR_IFINDEX, dev->ifindex) || + nla_put_u32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx) || + nla_put_string(msg, NL80211_ATTR_IFNAME, dev->name) || + nla_put_u32(msg, NL80211_ATTR_IFTYPE, + dev->ieee80211_ptr->iftype) || + nla_put_u32(msg, NL80211_ATTR_GENERATION, + rdev->devlist_generation ^ + (cfg80211_rdev_list_generation << 2))) + goto nla_put_failure; + if (rdev->ops->get_channel) { + struct ieee80211_channel *chan; + enum nl80211_channel_type channel_type; + + chan = rdev->ops->get_channel(&rdev->wiphy, &channel_type); - if (chan) { - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, - chan->center_freq); - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, - channel_type); - } ++ if (chan && ++ (nla_put_u32(msg, NL80211_ATTR_WIPHY_FREQ, ++ chan->center_freq) || ++ nla_put_u32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, ++ channel_type))) ++ goto nla_put_failure; + } + return genlmsg_end(msg, hdr); nla_put_failure: