[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1516931759-25178-1-git-send-email-baijiaju1990@gmail.com>
Date: Fri, 26 Jan 2018 09:55:59 +0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: 3chas3@...il.com
Cc: linux-atm-general@...ts.sourceforge.net, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH 1/2] atm: fore200e: Replace GFP_ATOMIC with GFP_KERNEL in fore200e_open
After checking all possible call chains to fore200e_open here,
my tool finds that fore200e_open is never called in atomic context.
And fore200e_open calls mutex_lock which can sleep later,
thus it is supposed fore200e_open can call functions which may sleep.
Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
This is found by a static analysis tool named DCNS written by myself.
Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
drivers/atm/fore200e.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index 6ebc4e4..bdffb85 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -1422,7 +1422,7 @@ int bsq_audit(int where, struct host_bsq* bsq, int scheme, int magn)
spin_unlock_irqrestore(&fore200e->q_lock, flags);
- fore200e_vcc = kzalloc(sizeof(struct fore200e_vcc), GFP_ATOMIC);
+ fore200e_vcc = kzalloc(sizeof(struct fore200e_vcc), GFP_KERNEL);
if (fore200e_vcc == NULL) {
vc_map->vcc = NULL;
return -ENOMEM;
--
1.7.9.5
Powered by blists - more mailing lists