From: julia.lawall@lip6.fr (Julia Lawall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] net: ethernet: fix call_kern.cocci warnings
Date: Sun, 17 Dec 2017 07:43:10 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.20.1712170739410.2501@hadrien> (raw)
From: Fengguang Wu <fengguang.wu@intel.com>
Allocation with GFP_KERNEL in code called from the function
geth_resize_freeq with locks held.
Generated by: scripts/coccinelle/locks/call_kern.cocci
Fixes: 502a2864e5e4 ("net: ethernet: Add a driver for Gemini gigabit ethernet")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---
The proposed change of converting the GFP_KERNEL is not necessarily the
correct one. It may be desired to unlock the lock, or to not call the
function under the lock in the first place.
tree:
https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git
gemini-ethernet
head: 502a2864e5e43c51a3a2689586d9c61d060a3b7d
commit: 502a2864e5e43c51a3a2689586d9c61d060a3b7d [18/18] net: ethernet:
Add a driver for Gemini gigabit ethernet
gemini.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/net/ethernet/cortina/gemini.c
+++ b/drivers/net/ethernet/cortina/gemini.c
@@ -818,7 +818,7 @@ static int geth_setup_freeq(struct gemin
geth->freeq_ring = dma_alloc_coherent(geth->dev,
sizeof(*geth->freeq_ring) << geth->freeq_order,
- &geth->freeq_dma_base, GFP_KERNEL);
+ &geth->freeq_dma_base, GFP_ATOMIC);
if (!geth->freeq_ring)
return -ENOMEM;
if (geth->freeq_dma_base & ~DMA_Q_BASE_MASK) {
@@ -827,7 +827,7 @@ static int geth_setup_freeq(struct gemin
}
geth->freeq_page_tab = kzalloc(pages * sizeof(*geth->freeq_page_tab),
- GFP_KERNEL);
+ GFP_ATOMIC);
if (!geth->freeq_page_tab)
goto err_freeq;
next reply other threads:[~2017-12-17 6:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-17 6:43 Julia Lawall [this message]
2017-12-17 22:47 ` [PATCH] net: ethernet: fix call_kern.cocci warnings Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1712170739410.2501@hadrien \
--to=julia.lawall@lip6.fr \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox