Skip to content

Commit 5c33d9b

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) New sysctl ndisc_notify needs some documentation, from Hanns Frederic Sowa. 2) Netfilter REJECT target doesn't set transport header of SKB correctly, from Mukund Jampala. 3) Forcedeth driver needs to check for DMA mapping failures, from Larry Finger. 4) brcmsmac driver can't use usleep_range while holding locks, use udelay instead. From Niels Ole Salscheider. 5) Fix unregister of netlink bridge multicast database handlers, from Vlad Yasevich and Rami Rosen. 6) Fix checksum calculations in netfilter's ipv6 network prefix translation module. 7) Fix high order page allocation failures in netfilter xt_recent, from Eric Dumazet. 8) mac802154 needs to use netif_rx_ni() instead of netif_rx() because mac802154_process_data() can execute in process rather than interrupt context. From Alexander Aring. 9) Fix splice handling of MSG_SENDPAGE_NOTLAST, otherwise we elide one tcp_push() too many. From Eric Dumazet and Willy Tarreau. 10) Fix skb->truesize tracking in XEN netfront driver, from Ian Campbell. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (46 commits) xen/netfront: improve truesize tracking ipv4: fix NULL checking in devinet_ioctl() tcp: fix MSG_SENDPAGE_NOTLAST logic net/ipv4/ipconfig: really display the BOOTP/DHCP server's address. ip-sysctl: fix spelling errors mac802154: fix NOHZ local_softirq_pending 08 warning ipv6: document ndisc_notify in networking/ip-sysctl.txt ath9k: Fix Kconfig for ATH9K_HTC netfilter: xt_recent: avoid high order page allocations netfilter: fix missing dependencies for the NOTRACK target netfilter: ip6t_NPT: fix IPv6 NTP checksum calculation bridge: add empty br_mdb_init() and br_mdb_uninit() definitions. vxlan: allow live mac address change bridge: Correctly unregister MDB rtnetlink handlers brcmfmac: fix parsing rsn ie for ap mode. brcmsmac: add copyright information for Canonical rtlwifi: rtl8723ae: Fix warning for unchecked pci_map_single() call rtlwifi: rtl8192se: Fix warning for unchecked pci_map_single() call rtlwifi: rtl8192de: Fix warning for unchecked pci_map_single() call rtlwifi: rtl8192ce: Fix warning for unchecked pci_map_single() call ...
2 parents 2a893f9 + d9a58a7 commit 5c33d9b

File tree

44 files changed

+353
-115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+353
-115
lines changed

Documentation/networking/ip-sysctl.txt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ neigh/default/unres_qlen_bytes - INTEGER
3636
The maximum number of bytes which may be used by packets
3737
queued for each unresolved address by other network layers.
3838
(added in linux 3.3)
39-
Seting negative value is meaningless and will retrun error.
39+
Setting negative value is meaningless and will return error.
4040
Default: 65536 Bytes(64KB)
4141

4242
neigh/default/unres_qlen - INTEGER
@@ -215,7 +215,7 @@ tcp_ecn - INTEGER
215215
Possible values are:
216216
0 Disable ECN. Neither initiate nor accept ECN.
217217
1 Always request ECN on outgoing connection attempts.
218-
2 Enable ECN when requested by incomming connections
218+
2 Enable ECN when requested by incoming connections
219219
but do not request ECN on outgoing connections.
220220
Default: 2
221221

@@ -503,7 +503,7 @@ tcp_fastopen - INTEGER
503503
tcp_syn_retries - INTEGER
504504
Number of times initial SYNs for an active TCP connection attempt
505505
will be retransmitted. Should not be higher than 255. Default value
506-
is 6, which corresponds to 63seconds till the last restransmission
506+
is 6, which corresponds to 63seconds till the last retransmission
507507
with the current initial RTO of 1second. With this the final timeout
508508
for an active TCP connection attempt will happen after 127seconds.
509509

@@ -1331,6 +1331,12 @@ force_tllao - BOOLEAN
13311331
race condition where the sender deletes the cached link-layer address
13321332
prior to receiving a response to a previous solicitation."
13331333

1334+
ndisc_notify - BOOLEAN
1335+
Define mode for notification of address and device changes.
1336+
0 - (default): do nothing
1337+
1 - Generate unsolicited neighbour advertisements when device is brought
1338+
up or hardware address changes.
1339+
13341340
icmp/*:
13351341
ratelimit - INTEGER
13361342
Limit the maximal rates for sending ICMPv6 packets.
@@ -1530,7 +1536,7 @@ cookie_hmac_alg - STRING
15301536
* sha1
15311537
* none
15321538
Ability to assign md5 or sha1 as the selected alg is predicated on the
1533-
configuarion of those algorithms at build time (CONFIG_CRYPTO_MD5 and
1539+
configuration of those algorithms at build time (CONFIG_CRYPTO_MD5 and
15341540
CONFIG_CRYPTO_SHA1).
15351541

15361542
Default: Dependent on configuration. MD5 if available, else SHA1 if
@@ -1548,7 +1554,7 @@ rcvbuf_policy - INTEGER
15481554
blocking.
15491555

15501556
1: rcvbuf space is per association
1551-
0: recbuf space is per socket
1557+
0: rcvbuf space is per socket
15521558

15531559
Default: 0
15541560

drivers/bcma/Kconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ config BCMA_DRIVER_GMAC_CMN
6767

6868
config BCMA_DRIVER_GPIO
6969
bool "BCMA GPIO driver"
70-
depends on BCMA
71-
select GPIOLIB
70+
depends on BCMA && GPIOLIB
7271
help
7372
Driver to provide access to the GPIO pins of the bcma bus.
7473

drivers/bcma/driver_chipcommon_sflash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static struct bcma_sflash_tbl_e bcma_sflash_st_tbl[] = {
3535
{ "M25P40", 0x12, 0x10000, 8, },
3636

3737
{ "M25P16", 0x14, 0x10000, 32, },
38-
{ "M25P32", 0x14, 0x10000, 64, },
38+
{ "M25P32", 0x15, 0x10000, 64, },
3939
{ "M25P64", 0x16, 0x10000, 128, },
4040
{ "M25FL128", 0x17, 0x10000, 256, },
4141
{ 0 },

drivers/net/ethernet/nvidia/forcedeth.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,6 +1821,11 @@ static int nv_alloc_rx(struct net_device *dev)
18211821
skb->data,
18221822
skb_tailroom(skb),
18231823
PCI_DMA_FROMDEVICE);
1824+
if (pci_dma_mapping_error(np->pci_dev,
1825+
np->put_rx_ctx->dma)) {
1826+
kfree_skb(skb);
1827+
goto packet_dropped;
1828+
}
18241829
np->put_rx_ctx->dma_len = skb_tailroom(skb);
18251830
np->put_rx.orig->buf = cpu_to_le32(np->put_rx_ctx->dma);
18261831
wmb();
@@ -1830,6 +1835,7 @@ static int nv_alloc_rx(struct net_device *dev)
18301835
if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
18311836
np->put_rx_ctx = np->first_rx_ctx;
18321837
} else {
1838+
packet_dropped:
18331839
u64_stats_update_begin(&np->swstats_rx_syncp);
18341840
np->stat_rx_dropped++;
18351841
u64_stats_update_end(&np->swstats_rx_syncp);
@@ -1856,6 +1862,11 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
18561862
skb->data,
18571863
skb_tailroom(skb),
18581864
PCI_DMA_FROMDEVICE);
1865+
if (pci_dma_mapping_error(np->pci_dev,
1866+
np->put_rx_ctx->dma)) {
1867+
kfree_skb(skb);
1868+
goto packet_dropped;
1869+
}
18591870
np->put_rx_ctx->dma_len = skb_tailroom(skb);
18601871
np->put_rx.ex->bufhigh = cpu_to_le32(dma_high(np->put_rx_ctx->dma));
18611872
np->put_rx.ex->buflow = cpu_to_le32(dma_low(np->put_rx_ctx->dma));
@@ -1866,6 +1877,7 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
18661877
if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
18671878
np->put_rx_ctx = np->first_rx_ctx;
18681879
} else {
1880+
packet_dropped:
18691881
u64_stats_update_begin(&np->swstats_rx_syncp);
18701882
np->stat_rx_dropped++;
18711883
u64_stats_update_end(&np->swstats_rx_syncp);
@@ -2217,6 +2229,15 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
22172229
bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
22182230
np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt,
22192231
PCI_DMA_TODEVICE);
2232+
if (pci_dma_mapping_error(np->pci_dev,
2233+
np->put_tx_ctx->dma)) {
2234+
/* on DMA mapping error - drop the packet */
2235+
kfree_skb(skb);
2236+
u64_stats_update_begin(&np->swstats_tx_syncp);
2237+
np->stat_tx_dropped++;
2238+
u64_stats_update_end(&np->swstats_tx_syncp);
2239+
return NETDEV_TX_OK;
2240+
}
22202241
np->put_tx_ctx->dma_len = bcnt;
22212242
np->put_tx_ctx->dma_single = 1;
22222243
put_tx->buf = cpu_to_le32(np->put_tx_ctx->dma);
@@ -2337,6 +2358,15 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
23372358
bcnt = (size > NV_TX2_TSO_MAX_SIZE) ? NV_TX2_TSO_MAX_SIZE : size;
23382359
np->put_tx_ctx->dma = pci_map_single(np->pci_dev, skb->data + offset, bcnt,
23392360
PCI_DMA_TODEVICE);
2361+
if (pci_dma_mapping_error(np->pci_dev,
2362+
np->put_tx_ctx->dma)) {
2363+
/* on DMA mapping error - drop the packet */
2364+
kfree_skb(skb);
2365+
u64_stats_update_begin(&np->swstats_tx_syncp);
2366+
np->stat_tx_dropped++;
2367+
u64_stats_update_end(&np->swstats_tx_syncp);
2368+
return NETDEV_TX_OK;
2369+
}
23402370
np->put_tx_ctx->dma_len = bcnt;
23412371
np->put_tx_ctx->dma_single = 1;
23422372
put_tx->bufhigh = cpu_to_le32(dma_high(np->put_tx_ctx->dma));
@@ -5003,6 +5033,11 @@ static int nv_loopback_test(struct net_device *dev)
50035033
test_dma_addr = pci_map_single(np->pci_dev, tx_skb->data,
50045034
skb_tailroom(tx_skb),
50055035
PCI_DMA_FROMDEVICE);
5036+
if (pci_dma_mapping_error(np->pci_dev,
5037+
test_dma_addr)) {
5038+
dev_kfree_skb_any(tx_skb);
5039+
goto out;
5040+
}
50065041
pkt_data = skb_put(tx_skb, pkt_len);
50075042
for (i = 0; i < pkt_len; i++)
50085043
pkt_data[i] = (u8)(i & 0xff);

drivers/net/usb/qmi_wwan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ static const struct usb_device_id products[] = {
458458
{QMI_FIXED_INTF(0x1199, 0x68a2, 8)}, /* Sierra Wireless MC7710 in QMI mode */
459459
{QMI_FIXED_INTF(0x1199, 0x68a2, 19)}, /* Sierra Wireless MC7710 in QMI mode */
460460
{QMI_FIXED_INTF(0x1199, 0x901c, 8)}, /* Sierra Wireless EM7700 */
461+
{QMI_FIXED_INTF(0x1bbb, 0x011e, 4)}, /* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
461462

462463
/* 4. Gobi 1000 devices */
463464
{QMI_GOBI1K_DEVICE(0x05c6, 0x9212)}, /* Acer Gobi Modem Device */

drivers/net/vxlan.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,6 +1191,7 @@ static void vxlan_setup(struct net_device *dev)
11911191

11921192
dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
11931193
dev->priv_flags &= ~IFF_XMIT_DST_RELEASE;
1194+
dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
11941195

11951196
spin_lock_init(&vxlan->hash_lock);
11961197

drivers/net/wireless/ath/ath9k/Kconfig

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ config ATH9K_HW
22
tristate
33
config ATH9K_COMMON
44
tristate
5+
select ATH_COMMON
56
config ATH9K_DFS_DEBUGFS
67
def_bool y
78
depends on ATH9K_DEBUGFS && ATH9K_DFS_CERTIFIED
@@ -17,7 +18,6 @@ config ATH9K_BTCOEX_SUPPORT
1718
config ATH9K
1819
tristate "Atheros 802.11n wireless cards support"
1920
depends on MAC80211
20-
select ATH_COMMON
2121
select ATH9K_HW
2222
select MAC80211_LEDS
2323
select LEDS_CLASS
@@ -56,7 +56,8 @@ config ATH9K_AHB
5656

5757
config ATH9K_DEBUGFS
5858
bool "Atheros ath9k debugging"
59-
depends on ATH9K && DEBUG_FS
59+
depends on ATH9K
60+
select MAC80211_DEBUGFS
6061
---help---
6162
Say Y, if you need access to ath9k's statistics for
6263
interrupts, rate control, etc.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ static void ar9003_rx_gain_table_mode0(struct ath_hw *ah)
544544
ar9340Common_rx_gain_table_1p0);
545545
else if (AR_SREV_9485_11(ah))
546546
INIT_INI_ARRAY(&ah->iniModesRxGain,
547-
ar9485Common_wo_xlna_rx_gain_1_1);
547+
ar9485_common_rx_gain_1_1);
548548
else if (AR_SREV_9550(ah)) {
549549
INIT_INI_ARRAY(&ah->iniModesRxGain,
550550
ar955x_1p0_common_rx_gain_table);

drivers/net/wireless/ath/carl9170/fw.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,12 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len)
336336
if (SUPP(CARL9170FW_WLANTX_CAB)) {
337337
if_comb_types |=
338338
BIT(NL80211_IFTYPE_AP) |
339-
BIT(NL80211_IFTYPE_MESH_POINT) |
340339
BIT(NL80211_IFTYPE_P2P_GO);
340+
341+
#ifdef CONFIG_MAC80211_MESH
342+
if_comb_types |=
343+
BIT(NL80211_IFTYPE_MESH_POINT);
344+
#endif /* CONFIG_MAC80211_MESH */
341345
}
342346
}
343347

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3091,10 +3091,11 @@ brcmf_configure_wpaie(struct net_device *ndev, struct brcmf_vs_tlv *wpa_ie,
30913091

30923092
len = wpa_ie->len + TLV_HDR_LEN;
30933093
data = (u8 *)wpa_ie;
3094-
offset = 0;
3094+
offset = TLV_HDR_LEN;
30953095
if (!is_rsn_ie)
30963096
offset += VS_IE_FIXED_HDR_LEN;
3097-
offset += WPA_IE_VERSION_LEN;
3097+
else
3098+
offset += WPA_IE_VERSION_LEN;
30983099

30993100
/* check for multicast cipher suite */
31003101
if (offset + WPA_IE_MIN_OUI_LEN > len) {

drivers/net/wireless/brcm80211/brcmsmac/debug.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
22
* Copyright (c) 2012 Broadcom Corporation
3+
* Copyright (c) 2012 Canonical Ltd.
34
*
45
* Permission to use, copy, modify, and/or distribute this software for any
56
* purpose with or without fee is hereby granted, provided that the above

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,13 +1343,13 @@ static bool wlc_lcnphy_rx_iq_cal_gain(struct brcms_phy *pi, u16 biq1_gain,
13431343

13441344
wlc_lcnphy_rx_gain_override_enable(pi, true);
13451345
wlc_lcnphy_start_tx_tone(pi, 2000, (40 >> 1), 0);
1346-
usleep_range(500, 500);
1346+
udelay(500);
13471347
write_radio_reg(pi, RADIO_2064_REG112, 0);
13481348
if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_l))
13491349
return false;
13501350

13511351
wlc_lcnphy_start_tx_tone(pi, 2000, 40, 0);
1352-
usleep_range(500, 500);
1352+
udelay(500);
13531353
write_radio_reg(pi, RADIO_2064_REG112, 0);
13541354
if (!wlc_lcnphy_rx_iq_est(pi, 1024, 32, &iq_est_h))
13551355
return false;

drivers/net/wireless/p54/p54usb.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ static struct usb_device_id p54u_table[] = {
4747
{USB_DEVICE(0x0411, 0x0050)}, /* Buffalo WLI2-USB2-G54 */
4848
{USB_DEVICE(0x045e, 0x00c2)}, /* Microsoft MN-710 */
4949
{USB_DEVICE(0x0506, 0x0a11)}, /* 3COM 3CRWE254G72 */
50+
{USB_DEVICE(0x0675, 0x0530)}, /* DrayTek Vigor 530 */
5051
{USB_DEVICE(0x06b9, 0x0120)}, /* Thomson SpeedTouch 120g */
5152
{USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */
5253
{USB_DEVICE(0x07aa, 0x001c)}, /* Corega CG-WLUSB2GT */
@@ -82,6 +83,8 @@ static struct usb_device_id p54u_table[] = {
8283
{USB_DEVICE(0x06a9, 0x000e)}, /* Westell 802.11g USB (A90-211WG-01) */
8384
{USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
8485
{USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
86+
{USB_DEVICE(0x0803, 0x4310)}, /* Zoom 4410a */
87+
{USB_DEVICE(0x083a, 0x4503)}, /* T-Com Sinus 154 data II */
8588
{USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
8689
{USB_DEVICE(0x083a, 0xc501)}, /* Zoom Wireless-G 4410 */
8790
{USB_DEVICE(0x083a, 0xf503)}, /* Accton FD7050E ver 1010ec */
@@ -101,6 +104,7 @@ static struct usb_device_id p54u_table[] = {
101104
{USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */
102105
{USB_DEVICE(0x1413, 0x5400)}, /* Telsey 802.11g USB2.0 Adapter */
103106
{USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */
107+
/* {USB_DEVICE(0x15a9, 0x0002)}, * Also SparkLAN WL-682 with 3887 */
104108
{USB_DEVICE(0x1668, 0x1050)}, /* Actiontec 802UIG-1 */
105109
{USB_DEVICE(0x1740, 0x1000)}, /* Senao NUB-350 */
106110
{USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */

drivers/net/wireless/rtlwifi/pci.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
743743

744744
done:
745745
bufferaddress = (*((dma_addr_t *)skb->cb));
746+
if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress))
747+
return;
746748
tmp_one = 1;
747749
rtlpriv->cfg->ops->set_desc((u8 *) pdesc, false,
748750
HW_DESC_RXBUFF_ADDR,
@@ -1115,6 +1117,10 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
11151117
PCI_DMA_FROMDEVICE);
11161118

11171119
bufferaddress = (*((dma_addr_t *)skb->cb));
1120+
if (pci_dma_mapping_error(rtlpci->pdev, bufferaddress)) {
1121+
dev_kfree_skb_any(skb);
1122+
return 1;
1123+
}
11181124
rtlpriv->cfg->ops->set_desc((u8 *)entry, false,
11191125
HW_DESC_RXBUFF_ADDR,
11201126
(u8 *)&bufferaddress);

drivers/net/wireless/rtlwifi/rtl8192ce/trx.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,14 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
611611
dma_addr_t mapping = pci_map_single(rtlpci->pdev,
612612
skb->data, skb->len,
613613
PCI_DMA_TODEVICE);
614+
614615
u8 bw_40 = 0;
615616

617+
if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
618+
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
619+
"DMA mapping error");
620+
return;
621+
}
616622
rcu_read_lock();
617623
sta = get_sta(hw, mac->vif, mac->bssid);
618624
if (mac->opmode == NL80211_IFTYPE_STATION) {
@@ -774,6 +780,11 @@ void rtl92ce_tx_fill_cmddesc(struct ieee80211_hw *hw,
774780
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
775781
__le16 fc = hdr->frame_control;
776782

783+
if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
784+
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
785+
"DMA mapping error");
786+
return;
787+
}
777788
CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
778789

779790
if (firstseg)

drivers/net/wireless/rtlwifi/rtl8192de/trx.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,11 @@ void rtl92de_tx_fill_desc(struct ieee80211_hw *hw,
587587
buf_len = skb->len;
588588
mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
589589
PCI_DMA_TODEVICE);
590+
if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
591+
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
592+
"DMA mapping error");
593+
return;
594+
}
590595
CLEAR_PCI_TX_DESC_CONTENT(pdesc, sizeof(struct tx_desc_92d));
591596
if (ieee80211_is_nullfunc(fc) || ieee80211_is_ctl(fc)) {
592597
firstseg = true;
@@ -740,6 +745,11 @@ void rtl92de_tx_fill_cmddesc(struct ieee80211_hw *hw,
740745
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)(skb->data);
741746
__le16 fc = hdr->frame_control;
742747

748+
if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
749+
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
750+
"DMA mapping error");
751+
return;
752+
}
743753
CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_DESC_SIZE);
744754
if (firstseg)
745755
SET_TX_DESC_OFFSET(pdesc, USB_HWDESC_HEADER_LEN);

drivers/net/wireless/rtlwifi/rtl8192se/trx.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,11 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
611611
PCI_DMA_TODEVICE);
612612
u8 bw_40 = 0;
613613

614+
if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
615+
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
616+
"DMA mapping error");
617+
return;
618+
}
614619
if (mac->opmode == NL80211_IFTYPE_STATION) {
615620
bw_40 = mac->bw_40;
616621
} else if (mac->opmode == NL80211_IFTYPE_AP ||
@@ -763,14 +768,20 @@ void rtl92se_tx_fill_desc(struct ieee80211_hw *hw,
763768
void rtl92se_tx_fill_cmddesc(struct ieee80211_hw *hw, u8 *pdesc,
764769
bool firstseg, bool lastseg, struct sk_buff *skb)
765770
{
771+
struct rtl_priv *rtlpriv = rtl_priv(hw);
766772
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
767773
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
768774
struct rtl_tcb_desc *tcb_desc = (struct rtl_tcb_desc *)(skb->cb);
769775

770776
dma_addr_t mapping = pci_map_single(rtlpci->pdev, skb->data, skb->len,
771777
PCI_DMA_TODEVICE);
772778

773-
/* Clear all status */
779+
if (pci_dma_mapping_error(rtlpci->pdev, mapping)) {
780+
RT_TRACE(rtlpriv, COMP_SEND, DBG_TRACE,
781+
"DMA mapping error");
782+
return;
783+
}
784+
/* Clear all status */
774785
CLEAR_PCI_TX_DESC_CONTENT(pdesc, TX_CMDDESC_SIZE_RTL8192S);
775786

776787
/* This bit indicate this packet is used for FW download. */

0 commit comments

Comments
 (0)