@@ -11596,7 +11596,11 @@ static int nl80211_switch_channel(void *priv, struct csa_settings *settings)
settings->cs_count)))
return -EINVAL;
- msg = nlmsg_alloc();
+ /* each interface channel switch request can be sizable as it contains
+ * a beacon and possibly a probe response. this size varies depending
+ * on the number of IEs. pre-allocate memory for the nlmsg. this could
+ * be probably caculated/estimated but 64KiB seems like a sane value */
+ msg = nlmsg_alloc_size(64 * 1024);
if (!msg)
return -ENOMEM;