Commit b6b0012c authored by Quentin Lambert's avatar Quentin Lambert Committed by Greg Kroah-Hartman

staging: rtl8192e: Remove unnecessary OOM message

This patch reduces the kernel size by removing error messages that duplicate
the normal OOM message.

A simplified version of the semantic patch that finds this problem is as
follows: (http://coccinelle.lip6.fr)

@@
identifier f,print,l;
expression e;
constant char[] c;
@@

e = \(kzalloc\|kmalloc\|devm_kzalloc\|devm_kmalloc\)(...);
if (e == NULL) {
  <+...
-  print(...,c,...);
  ... when any
(
  goto l;
|
  return ...;
)
  ...+> }
Signed-off-by: default avatarQuentin Lambert <lambert.quentin@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d08c028c
...@@ -72,11 +72,8 @@ static inline int rtllib_networks_allocate(struct rtllib_device *ieee) ...@@ -72,11 +72,8 @@ static inline int rtllib_networks_allocate(struct rtllib_device *ieee)
ieee->networks = kzalloc( ieee->networks = kzalloc(
MAX_NETWORK_COUNT * sizeof(struct rtllib_network), MAX_NETWORK_COUNT * sizeof(struct rtllib_network),
GFP_KERNEL); GFP_KERNEL);
if (!ieee->networks) { if (!ieee->networks)
printk(KERN_WARNING "%s: Out of memory allocating beacons\n",
ieee->dev->name);
return -ENOMEM; return -ENOMEM;
}
return 0; return 0;
} }
...@@ -161,10 +158,9 @@ struct net_device *alloc_rtllib(int sizeof_priv) ...@@ -161,10 +158,9 @@ struct net_device *alloc_rtllib(int sizeof_priv)
rtllib_softmac_init(ieee); rtllib_softmac_init(ieee);
ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL); ieee->pHTInfo = kzalloc(sizeof(struct rt_hi_throughput), GFP_KERNEL);
if (ieee->pHTInfo == NULL) { if (ieee->pHTInfo == NULL)
RTLLIB_DEBUG(RTLLIB_DL_ERR, "can't alloc memory for HTInfo\n");
return NULL; return NULL;
}
HTUpdateDefaultSetting(ieee); HTUpdateDefaultSetting(ieee);
HTInitializeHTInfo(ieee); HTInitializeHTInfo(ieee);
TSInitialize(ieee); TSInitialize(ieee);
......
...@@ -394,10 +394,9 @@ static int is_duplicate_packet(struct rtllib_device *ieee, ...@@ -394,10 +394,9 @@ static int is_duplicate_packet(struct rtllib_device *ieee,
} }
if (p == &ieee->ibss_mac_hash[index]) { if (p == &ieee->ibss_mac_hash[index]) {
entry = kmalloc(sizeof(struct ieee_ibss_seq), GFP_ATOMIC); entry = kmalloc(sizeof(struct ieee_ibss_seq), GFP_ATOMIC);
if (!entry) { if (!entry)
printk(KERN_WARNING "Cannot malloc new mac entry\n");
return 0; return 0;
}
memcpy(entry->mac, mac, ETH_ALEN); memcpy(entry->mac, mac, ETH_ALEN);
entry->seq_num[tid] = seq; entry->seq_num[tid] = seq;
entry->frag_num[tid] = frag; entry->frag_num[tid] = frag;
...@@ -1345,11 +1344,9 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb, ...@@ -1345,11 +1344,9 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
/* skb: hdr + (possible reassembled) full plaintext payload */ /* skb: hdr + (possible reassembled) full plaintext payload */
payload = skb->data + hdrlen; payload = skb->data + hdrlen;
rxb = kmalloc(sizeof(struct rtllib_rxb), GFP_ATOMIC); rxb = kmalloc(sizeof(struct rtllib_rxb), GFP_ATOMIC);
if (rxb == NULL) { if (rxb == NULL)
RTLLIB_DEBUG(RTLLIB_DL_ERR,
"%s(): kmalloc rxb error\n", __func__);
goto rx_dropped; goto rx_dropped;
}
/* to parse amsdu packets */ /* to parse amsdu packets */
/* qos data packets & reserved bit is 1 */ /* qos data packets & reserved bit is 1 */
if (parse_subframe(ieee, skb, rx_stats, rxb, src, dst) == 0) { if (parse_subframe(ieee, skb, rx_stats, rxb, src, dst) == 0) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment