On 8/9/2023 7:39 PM, David Lin wrote: snip
@@ -491,6 +511,17 @@ int mwifiex_cmd_802_11_associate(struct mwifiex_private *priv, sizeof(struct mwifiex_chan_scan_param_set); } + if (priv->adapter->host_mlme) { + host_mlme_tlv = (struct mwifiex_ie_types_host_mlme *)pos; + host_mlme_tlv->header.type = cpu_to_le16(TLV_TYPE_HOST_MLME); + host_mlme_tlv->header.len = sizeof(host_mlme_tlv->host_mlme);
cpu_to_le16(sizeof(host_mlme_tlv->host_mlme)) ??
+ host_mlme_tlv->host_mlme = 1; + pos += sizeof(host_mlme_tlv->header) + + host_mlme_tlv->header.len;
le16_to_cpu(host_mlme_tlv->header.len) ?? or just use sizeof(host_mlme_tlv->host_mlme)
+ host_mlme_tlv->header.len = + cpu_to_le16(host_mlme_tlv->header.len);
The approach currently being taken doesn't look sparse-compliant. You should write an le16 into a __le16 member; writing a cpu16 into a __le16 member and then converting in place using cpu_to_le16() is broken.
+ } +
The above jumped out at me while scanning your patch -- it failed my mental pattern matching.
/jeff