summaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/cosa.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-02-03 17:28:12 +0000
committerDavid S. Miller <davem@davemloft.net>2013-02-04 13:22:34 -0500
commit1d5d1fdc52b879d8d2bb40546472b4dcfd99f118 (patch)
tree1a473daf8616769c3aaa8272d2c64bfca0a43963 /drivers/net/wan/cosa.c
parent38673c8218a6bcaac97b0243089e33617e28f43f (diff)
downloadlinux-1d5d1fdc52b879d8d2bb40546472b4dcfd99f118.tar.gz
linux-1d5d1fdc52b879d8d2bb40546472b4dcfd99f118.tar.bz2
linux-1d5d1fdc52b879d8d2bb40546472b4dcfd99f118.zip
wan: Remove unnecessary alloc/OOM messages
alloc failures already get standardized OOM messages and a dump_stack. Hoist assigns from if tests. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/cosa.c')
-rw-r--r--drivers/net/wan/cosa.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 6aed238e573e..0179cefae438 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -795,8 +795,8 @@ static ssize_t cosa_read(struct file *file,
if (mutex_lock_interruptible(&chan->rlock))
return -ERESTARTSYS;
- if ((chan->rxdata = kmalloc(COSA_MTU, GFP_DMA|GFP_KERNEL)) == NULL) {
- pr_info("%s: cosa_read() - OOM\n", cosa->name);
+ chan->rxdata = kmalloc(COSA_MTU, GFP_DMA|GFP_KERNEL);
+ if (chan->rxdata == NULL) {
mutex_unlock(&chan->rlock);
return -ENOMEM;
}
@@ -874,9 +874,8 @@ static ssize_t cosa_write(struct file *file,
count = COSA_MTU;
/* Allocate the buffer */
- if ((kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA)) == NULL) {
- pr_notice("%s: cosa_write() OOM - dropping packet\n",
- cosa->name);
+ kbuf = kmalloc(count, GFP_KERNEL|GFP_DMA);
+ if (kbuf == NULL) {
up(&chan->wsem);
return -ENOMEM;
}