lkml.org 
[lkml]   [2020]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RFC 2/3] scsi: mpt: Replace a few uses of GFP_ATOMIC with GFP_KERNEL
Date
None of the relevant functions are called from an atomic context, so
allocate memory with GFP_KERNEL to give a better chance of allocating
memory.

Signed-off-by: Alex Dewar <alex.dewar90@gmail.com>
---
drivers/message/fusion/mptbase.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index b7136257b455..85fd9c3721ec 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -4254,14 +4254,14 @@ initChainBuffers(MPT_ADAPTER *ioc)
*/
if (ioc->ReqToChain == NULL) {
sz = ioc->req_depth * sizeof(int);
- mem = kmalloc(sz, GFP_ATOMIC);
+ mem = kmalloc(sz, GFP_KERNEL);
if (mem == NULL)
return -1;

ioc->ReqToChain = (int *) mem;
dinitprintk(ioc, printk(MYIOC_s_DEBUG_FMT "ReqToChain alloc @ %p, sz=%d bytes\n",
ioc->name, mem, sz));
- mem = kmalloc(sz, GFP_ATOMIC);
+ mem = kmalloc(sz, GFP_KERNEL);
if (mem == NULL)
return -1;

@@ -4328,7 +4328,7 @@ initChainBuffers(MPT_ADAPTER *ioc)

sz = num_chain * sizeof(int);
if (ioc->ChainToChain == NULL) {
- mem = kmalloc(sz, GFP_ATOMIC);
+ mem = kmalloc(sz, GFP_KERNEL);
if (mem == NULL)
return -1;

@@ -5283,7 +5283,7 @@ mpt_GetScsiPortSettings(MPT_ADAPTER *ioc, int portnum)
int sz;
u8 *mem;
sz = MPT_MAX_SCSI_DEVICES * sizeof(int);
- mem = kmalloc(sz, GFP_ATOMIC);
+ mem = kmalloc(sz, GFP_KERNEL);
if (mem == NULL)
return -EFAULT;

--
2.28.0
\
 
 \ /
  Last update: 2020-09-03 17:29    [W:0.087 / U:0.492 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site