diff options
author | Himadri Pandya <himadri18.07@gmail.com> | 2019-03-21 15:27:17 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-21 20:08:07 +0100 |
commit | 85b45eadbe6e605d3dae956404c4eb0aa06fe6d3 (patch) | |
tree | 56a996c4718a3d1e86655c339190208188d6ce25 /drivers/staging/netlogic | |
parent | 4a278a92958dfda6d0954957402338026f55d84a (diff) | |
download | lwn-85b45eadbe6e605d3dae956404c4eb0aa06fe6d3.tar.gz lwn-85b45eadbe6e605d3dae956404c4eb0aa06fe6d3.zip |
staging: netlogic: Remove unnecessary error print
Kmalloc normally produces a backtrace when there is not enough memory.
So it is unnecessary to print an error message that provides only this
information. Hence, remove pr_error() from memory allocation check.
Issue found using Coccinelle.
Signed-off-by: Himadri Pandya <himadri18.07@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/netlogic')
-rw-r--r-- | drivers/staging/netlogic/xlr_net.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index 1897b711d66d..07a06c532dee 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -386,10 +386,8 @@ static void *xlr_config_spill(struct xlr_net_priv *priv, int reg_start_0, base = priv->base_addr; spill_size = size; spill = kmalloc(spill_size + SMP_CACHE_BYTES, GFP_ATOMIC); - if (!spill) { - pr_err("Unable to allocate memory for spill area!\n"); + if (!spill) return ZERO_SIZE_PTR; - } spill = PTR_ALIGN(spill, SMP_CACHE_BYTES); phys_addr = virt_to_phys(spill); |