lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  3 Sep 2020 16:28:31 +0100
From:   Alex Dewar <alex.dewar90@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Alex Dewar <alex.dewar90@...il.com>,
        Sathya Prakash <sathya.prakash@...adcom.com>,
        Sreekanth Reddy <sreekanth.reddy@...adcom.com>,
        Suganath Prabu Subramani 
        <suganath-prabu.subramani@...adcom.com>,
        MPT-FusionLinux.pdl@...adcom.com, linux-scsi@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH RFC 2/3] scsi: mpt: Replace a few uses of GFP_ATOMIC with GFP_KERNEL

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ