[openib-general] [PATCH] Fix GFP mask inside spinlock

Roland Dreier
Mon Oct 25 13:24:23 PDT 2004


Actually allocate_method_table() needs the same treatment... here's an
updated patch:

Index: linux-kernel/infiniband/core/ib_mad.c
===================================================================
--- linux-kernel.orig/infiniband/core/ib_mad.c  2004-10-25 12:16:15.000000000 -0700
+++ linux-kernel/infiniband/core/ib_mad.c       2004-10-25 13:23:27.000000000 -0700
@@ -524,7 +524,7 @@
 static int allocate_method_table(struct ib_mad_mgmt_method_table **method)
 {
        /* Allocate management method table */
-       *method = kmalloc(sizeof **method, GFP_KERNEL);
+       *method = kmalloc(sizeof **method, GFP_ATOMIC);
        if (!*method) {
                printk(KERN_ERR PFX "No memory for ib_mad_mgmt_method_table\n");
                return -ENOMEM;
@@ -597,7 +597,7 @@
        class = &private->version[mad_reg_req->mgmt_class_version];
        if (!*class) {
                /* Allocate management class table for "new" class version */
-               *class = kmalloc(sizeof **class, GFP_KERNEL);
+               *class = kmalloc(sizeof **class, GFP_ATOMIC);
                if (!*class) {
                        printk(KERN_ERR PFX "No memory for "
                               "ib_mad_mgmt_class_table\n");


More information about the openib-general mailing list