From 1d5d1fdc52b879d8d2bb40546472b4dcfd99f118 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Sun, 3 Feb 2013 17:28:12 +0000 Subject: 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 Signed-off-by: David S. Miller --- drivers/net/wan/cosa.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/net/wan/cosa.c') 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; } -- cgit 1.4.1