* [patch] scsi/initio: add GFP_KERNEL flag
@ 2010-07-17 10:24 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2010-07-17 10:24 UTC (permalink / raw)
To: James E.J. Bottomley
Cc: Jiri Kosina, Daniel Mack, linux-scsi, kernel-janitors
Calling scb = kzalloc(i, GFP_DMA) is not the right idea. If this is
what we really wanted it would be better to specify it explicitly as
kzalloc(i, GFP_NOWAIT | GFP_DMA). But in this case it's OK to wait so
I changed it to use GFP_KERNEL. Also I added a __GFP_NOWARN, since we
expect the allocation to fail occasionaly (and we just try allocate a
smaller amount on the next time through the loop).
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c
index a771416..a4baa44 100644
--- a/drivers/scsi/initio.c
+++ b/drivers/scsi/initio.c
@@ -2885,7 +2885,8 @@ static int initio_probe_one(struct pci_dev *pdev,
for (; num_scb >= MAX_TARGETS + 3; num_scb--) {
i = num_scb * sizeof(struct scsi_ctrl_blk);
- if ((scb = kzalloc(i, GFP_DMA)) != NULL)
+ scb = kzalloc(i, GFP_KERNEL | GFP_DMA | __GFP_NOWARN);
+ if (scb)
break;
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-07-17 10:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-17 10:24 [patch] scsi/initio: add GFP_KERNEL flag Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).