Skip to content

Commit 5083850

Browse files
XidianGeneralmartinkpetersen
authored andcommitted
scsi: message: fusion: Replace GFP_ATOMIC with GFP_KERNEL
mpt_attach() and mptfc_probe() are never called in atomic context. They call kzalloc() and kcalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC 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@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent cc74e31 commit 5083850

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/message/fusion/mptbase.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1780,7 +1780,7 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id)
17801780
struct proc_dir_entry *dent;
17811781
#endif
17821782

1783-
ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_ATOMIC);
1783+
ioc = kzalloc(sizeof(MPT_ADAPTER), GFP_KERNEL);
17841784
if (ioc == NULL) {
17851785
printk(KERN_ERR MYNAM ": ERROR - Insufficient memory to add adapter!\n");
17861786
return -ENOMEM;

‎drivers/message/fusion/mptfc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
12921292
/* SCSI needs scsi_cmnd lookup table!
12931293
* (with size equal to req_depth*PtrSz!)
12941294
*/
1295-
ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_ATOMIC);
1295+
ioc->ScsiLookup = kcalloc(ioc->req_depth, sizeof(void *), GFP_KERNEL);
12961296
if (!ioc->ScsiLookup) {
12971297
error = -ENOMEM;
12981298
goto out_mptfc_probe;

0 commit comments

Comments
 (0)