Browse Source

qcacld-3.0: Print the remaining length when nla_put fails

nla_put fails when there is no sufficient buffer to put the
beacon IEs. Enhance the log to print available buffer length and
the beacon IEs length.

Change-Id: If6e37455f6fbe795b293f626ad9cbb24a9effcd0
CRs-Fixed: 2629807
Srinivas Dasari 5 years ago
parent
commit
37148c7604
1 changed files with 2 additions and 3 deletions
  1. 2 3
      core/hdd/src/wlan_hdd_station_info.c

+ 2 - 3
core/hdd/src/wlan_hdd_station_info.c

@@ -693,11 +693,11 @@ static int hdd_get_station_info(struct hdd_context *hdd_ctx,
 
 	if (ie_len) {
 		if (nla_put(skb, BEACON_IES, ie_len, ies)) {
-			hdd_err("Failed to put beacon IEs");
+			hdd_err("Failed to put beacon IEs: bytes left: %d, ie_len: %u total buf_len: %u",
+				skb_tailroom(skb), ie_len, nl_buf_len);
 			goto fail;
 		}
 		qdf_mem_free(ies);
-		ie_len = 0;
 	}
 
 	return cfg80211_vendor_cmd_reply(skb);
@@ -705,7 +705,6 @@ fail:
 	if (skb)
 		kfree_skb(skb);
 	qdf_mem_free(ies);
-	ie_len = 0;
 	return -EINVAL;
 }