Skip to content

Commit fe57beb

Browse files
author
Kalle Valo
committed
Merge tag 'ath-next-20240909' of git://git.kernel.org/pub/scm/linux/kernel/git/ath/ath
ath.git patches for v6.12 This is once again a fairly light pull request since ath12k is still working on MLO-related changes, and the other drivers are mostly in maintenance mode. ath12k * Fix a frame-larger-than warning seen with debug builds * Fix flex-array-member-not-at-end warnings ath11k * Fix flex-array-member-not-at-end warnings ath9k * Fix a syzbot-reported issue on USB-based devices
2 parents abbd838 + 02f454f commit fe57beb

File tree

6 files changed

+46
-65
lines changed

6 files changed

+46
-65
lines changed

drivers/net/wireless/ath/ath11k/core.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,17 @@ struct ath11k_vif {
407407
bool wpaie_present;
408408
bool bcca_zero_sent;
409409
bool do_not_send_tmpl;
410-
struct ieee80211_chanctx_conf chanctx;
411410
struct ath11k_arp_ns_offload arp_ns_offload;
412411
struct ath11k_rekey_data rekey_data;
413412

414413
struct ath11k_reg_tpc_power_info reg_tpc_info;
414+
415+
/* Must be last - ends in a flexible-array member.
416+
*
417+
* FIXME: Driver should not copy struct ieee80211_chanctx_conf,
418+
* especially because it has a flexible array. Find a better way.
419+
*/
420+
struct ieee80211_chanctx_conf chanctx;
415421
};
416422

417423
struct ath11k_vif_iter {

drivers/net/wireless/ath/ath11k/dp.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,18 +1305,6 @@ struct htt_ppdu_stats_user_rate {
13051305
#define HTT_TX_INFO_PEERID(_flags) \
13061306
FIELD_GET(HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M, _flags)
13071307

1308-
struct htt_tx_ppdu_stats_info {
1309-
struct htt_tlv tlv_hdr;
1310-
u32 tx_success_bytes;
1311-
u32 tx_retry_bytes;
1312-
u32 tx_failed_bytes;
1313-
u32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */
1314-
u16 tx_success_msdus;
1315-
u16 tx_retry_msdus;
1316-
u16 tx_failed_msdus;
1317-
u16 tx_duration; /* united in us */
1318-
} __packed;
1319-
13201308
enum htt_ppdu_stats_usr_compln_status {
13211309
HTT_PPDU_STATS_USER_STATUS_OK,
13221310
HTT_PPDU_STATS_USER_STATUS_FILTERED,
@@ -1364,17 +1352,6 @@ struct htt_ppdu_stats_usr_cmpltn_ack_ba_status {
13641352
u32 success_bytes;
13651353
} __packed;
13661354

1367-
struct htt_ppdu_stats_usr_cmn_array {
1368-
struct htt_tlv tlv_hdr;
1369-
u32 num_ppdu_stats;
1370-
/* tx_ppdu_stats_info is filled by multiple struct htt_tx_ppdu_stats_info
1371-
* elements.
1372-
* tx_ppdu_stats_info is variable length, with length =
1373-
* number_of_ppdu_stats * sizeof (struct htt_tx_ppdu_stats_info)
1374-
*/
1375-
struct htt_tx_ppdu_stats_info tx_ppdu_info[];
1376-
} __packed;
1377-
13781355
struct htt_ppdu_user_stats {
13791356
u16 peer_id;
13801357
u32 tlv_flags;

drivers/net/wireless/ath/ath12k/core.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,20 @@ struct ath12k_vif {
287287
int txpower;
288288
bool rsnie_present;
289289
bool wpaie_present;
290-
struct ieee80211_chanctx_conf chanctx;
291290
u32 key_cipher;
292291
u8 tx_encap_type;
293292
u8 vdev_stats_id;
294293
u32 punct_bitmap;
295294
bool ps;
296295
struct ath12k_vif_cache *cache;
297296
struct ath12k_rekey_data rekey_data;
297+
298+
/* Must be last - ends in a flexible-array member.
299+
*
300+
* FIXME: Driver should not copy struct ieee80211_chanctx_conf,
301+
* especially because it has a flexible array. Find a better way.
302+
*/
303+
struct ieee80211_chanctx_conf chanctx;
298304
};
299305

300306
struct ath12k_vif_iter {

drivers/net/wireless/ath/ath12k/dp.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1495,18 +1495,6 @@ struct htt_ppdu_stats_user_rate {
14951495
#define HTT_TX_INFO_PEERID(_flags) \
14961496
u32_get_bits(_flags, HTT_PPDU_STATS_TX_INFO_FLAGS_PEERID_M)
14971497

1498-
struct htt_tx_ppdu_stats_info {
1499-
struct htt_tlv tlv_hdr;
1500-
__le32 tx_success_bytes;
1501-
__le32 tx_retry_bytes;
1502-
__le32 tx_failed_bytes;
1503-
__le32 flags; /* %HTT_PPDU_STATS_TX_INFO_FLAGS_ */
1504-
__le16 tx_success_msdus;
1505-
__le16 tx_retry_msdus;
1506-
__le16 tx_failed_msdus;
1507-
__le16 tx_duration; /* united in us */
1508-
} __packed;
1509-
15101498
enum htt_ppdu_stats_usr_compln_status {
15111499
HTT_PPDU_STATS_USER_STATUS_OK,
15121500
HTT_PPDU_STATS_USER_STATUS_FILTERED,

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3663,7 +3663,7 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,
36633663
struct ath12k *ar, *prev_ar;
36643664
struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif);
36653665
struct cfg80211_scan_request *req = &hw_req->req;
3666-
struct ath12k_wmi_scan_req_arg arg = {};
3666+
struct ath12k_wmi_scan_req_arg *arg = NULL;
36673667
int ret;
36683668
int i;
36693669
bool create = true;
@@ -3745,42 +3745,47 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,
37453745
if (ret)
37463746
goto exit;
37473747

3748-
ath12k_wmi_start_scan_init(ar, &arg);
3749-
arg.vdev_id = arvif->vdev_id;
3750-
arg.scan_id = ATH12K_SCAN_ID;
3748+
arg = kzalloc(sizeof(*arg), GFP_KERNEL);
3749+
if (!arg) {
3750+
ret = -ENOMEM;
3751+
goto exit;
3752+
}
3753+
3754+
ath12k_wmi_start_scan_init(ar, arg);
3755+
arg->vdev_id = arvif->vdev_id;
3756+
arg->scan_id = ATH12K_SCAN_ID;
37513757

37523758
if (req->ie_len) {
3753-
arg.extraie.ptr = kmemdup(req->ie, req->ie_len, GFP_KERNEL);
3754-
if (!arg.extraie.ptr) {
3759+
arg->extraie.ptr = kmemdup(req->ie, req->ie_len, GFP_KERNEL);
3760+
if (!arg->extraie.ptr) {
37553761
ret = -ENOMEM;
37563762
goto exit;
37573763
}
3758-
arg.extraie.len = req->ie_len;
3764+
arg->extraie.len = req->ie_len;
37593765
}
37603766

37613767
if (req->n_ssids) {
3762-
arg.num_ssids = req->n_ssids;
3763-
for (i = 0; i < arg.num_ssids; i++)
3764-
arg.ssid[i] = req->ssids[i];
3768+
arg->num_ssids = req->n_ssids;
3769+
for (i = 0; i < arg->num_ssids; i++)
3770+
arg->ssid[i] = req->ssids[i];
37653771
} else {
3766-
arg.scan_f_passive = 1;
3772+
arg->scan_f_passive = 1;
37673773
}
37683774

37693775
if (req->n_channels) {
3770-
arg.num_chan = req->n_channels;
3771-
arg.chan_list = kcalloc(arg.num_chan, sizeof(*arg.chan_list),
3772-
GFP_KERNEL);
3773-
3774-
if (!arg.chan_list) {
3776+
arg->num_chan = req->n_channels;
3777+
arg->chan_list = kcalloc(arg->num_chan, sizeof(*arg->chan_list),
3778+
GFP_KERNEL);
3779+
if (!arg->chan_list) {
37753780
ret = -ENOMEM;
37763781
goto exit;
37773782
}
37783783

3779-
for (i = 0; i < arg.num_chan; i++)
3780-
arg.chan_list[i] = req->channels[i]->center_freq;
3784+
for (i = 0; i < arg->num_chan; i++)
3785+
arg->chan_list[i] = req->channels[i]->center_freq;
37813786
}
37823787

3783-
ret = ath12k_start_scan(ar, &arg);
3788+
ret = ath12k_start_scan(ar, arg);
37843789
if (ret) {
37853790
ath12k_warn(ar->ab, "failed to start hw scan: %d\n", ret);
37863791
spin_lock_bh(&ar->data_lock);
@@ -3790,14 +3795,15 @@ static int ath12k_mac_op_hw_scan(struct ieee80211_hw *hw,
37903795

37913796
/* Add a margin to account for event/command processing */
37923797
ieee80211_queue_delayed_work(ath12k_ar_to_hw(ar), &ar->scan.timeout,
3793-
msecs_to_jiffies(arg.max_scan_time +
3798+
msecs_to_jiffies(arg->max_scan_time +
37943799
ATH12K_MAC_SCAN_TIMEOUT_MSECS));
37953800

37963801
exit:
3797-
kfree(arg.chan_list);
3798-
3799-
if (req->ie_len)
3800-
kfree(arg.extraie.ptr);
3802+
if (arg) {
3803+
kfree(arg->chan_list);
3804+
kfree(arg->extraie.ptr);
3805+
kfree(arg);
3806+
}
38013807

38023808
mutex_unlock(&ar->conf_mutex);
38033809

drivers/net/wireless/ath/ath9k/hif_usb.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -716,8 +716,7 @@ static void ath9k_hif_usb_rx_cb(struct urb *urb)
716716
}
717717

718718
resubmit:
719-
skb_reset_tail_pointer(skb);
720-
skb_trim(skb, 0);
719+
__skb_set_length(skb, 0);
721720

722721
usb_anchor_urb(urb, &hif_dev->rx_submitted);
723722
ret = usb_submit_urb(urb, GFP_ATOMIC);
@@ -754,8 +753,7 @@ static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
754753
case -ESHUTDOWN:
755754
goto free_skb;
756755
default:
757-
skb_reset_tail_pointer(skb);
758-
skb_trim(skb, 0);
756+
__skb_set_length(skb, 0);
759757

760758
goto resubmit;
761759
}

0 commit comments

Comments
 (0)