Skip to content

Commit

Permalink
staging: wilc1000: linux_mon: remove debug message of kmalloc failure
Browse files Browse the repository at this point in the history
There is no need to print debug message when kmalloc is failed.
This message is redundant. The code already show us that kmalloc is
failed. The braces of first if statement is remove as well because if
statement has a single statement.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chaehyun Lim authored and Greg Kroah-Hartman committed Feb 3, 2016
1 parent b026f6e commit e534995
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/staging/wilc1000/linux_mon.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,14 +164,11 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)

netif_stop_queue(dev);
mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC);
if (!mgmt_tx) {
PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
if (!mgmt_tx)
return -ENOMEM;
}

mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
if (!mgmt_tx->buff) {
PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
kfree(mgmt_tx);
return -ENOMEM;
}
Expand Down

0 comments on commit e534995

Please sign in to comment.