Skip to contentSkip to conversation

orinoco: Delete an error message for a failed memory allocation in three functions

PATCH New SF Markus Elfring 1 participant 1 message Dec 30, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 orinoco: Delete an error message for a failed memory allocation in three functions

From: Markus Elfring <[email protected]>
Date: Sat, 30 Dec 2017 20:20:56 +0100

Omit an extra message for a memory allocation failure in these functions.

This issue was detected by using the Coccinelle software.

---
 drivers/net/wireless/intersil/orinoco/main.c        | 10 ++--------
 drivers/net/wireless/intersil/orinoco/orinoco_usb.c |  5 ++---
 2 files changed, 4 insertions(+), 11 deletions(-)
drivers/net/wireless/intersil/orinoco/main.c +2 -8
index 28dac36d7c4c..0b214f92a503 100644
@@ -785,11 +785,8 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid,
 	}
 
 	skb = dev_alloc_skb(hdrlen + datalen);
-	if (!skb) {
-		printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n",
-		       dev->name);
+	if (!skb)
 		goto update_stats;
-	}
 
 	/* Copy the 802.11 header to the skb */
 	skb_put_data(skb, &(desc->frame_ctl), hdrlen);
@@ -900,11 +897,8 @@ void __orinoco_ev_rx(struct net_device *dev, struct hermes *hw)
 	   packets from the card, which has an IO granularity of 16
 	   bits */
 	skb = dev_alloc_skb(length + ETH_HLEN + 2 + 1);
-	if (!skb) {
-		printk(KERN_WARNING "%s: Can't allocate skb for Rx\n",
-		       dev->name);
+	if (!skb)
 		goto update_stats;
-	}
 
 	/* We'll prepend the header, so reserve space for it.  The worst
 	   case is no decapsulation, when 802.3 header is prepended and
drivers/net/wireless/intersil/orinoco/orinoco_usb.c +2 -3
index 501180584b4b..8ef96a1c231f 100644
@@ -805,10 +805,9 @@ static int ezusb_firmware_download(struct ezusb_priv *upriv,
 	int variant_offset;
 
 	fw_buffer = kmalloc(FW_BUF_SIZE, GFP_KERNEL);
-	if (!fw_buffer) {
-		printk(KERN_ERR PFX "Out of memory for firmware buffer.\n");
+	if (!fw_buffer)
 		return -ENOMEM;
-	}
+
 	/*
 	 * This byte is 1 and should be replaced with 0.  The offset is
 	 * 0x10AD in version 0.0.6.  The byte in question should follow
Signature · 1 line
2.15.1