Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1c8ea5aee0b16409295d96a5e8984bd902f06a77
Commit:     1c8ea5aee0b16409295d96a5e8984bd902f06a77
Parent:     14690fc649f4c59712f497135f7323eb8ceceaaf
Author:     Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 01:36:49 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Thu Apr 26 01:36:49 2007 -0700

    [IRDA] irda_device_dongle_init: fix kzalloc(GFP_KERNEL) in spinlock
    
    Fix http://bugzilla.kernel.org/show_bug.cgi?id=8343
    
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Samuel Ortiz <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/irda/irda_device.c |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/net/irda/irda_device.c b/net/irda/irda_device.c
index e717801..7b5def1 100644
--- a/net/irda/irda_device.c
+++ b/net/irda/irda_device.c
@@ -375,7 +375,7 @@ EXPORT_SYMBOL(alloc_irdadev);
 dongle_t *irda_device_dongle_init(struct net_device *dev, int type)
 {
        struct dongle_reg *reg;
-       dongle_t *dongle = NULL;
+       dongle_t *dongle = kzalloc(sizeof(dongle_t), GFP_KERNEL);
 
        might_sleep();
 
@@ -397,19 +397,14 @@ dongle_t *irda_device_dongle_init(struct net_device *dev, 
int type)
        if (!reg || !try_module_get(reg->owner) ) {
                IRDA_ERROR("IrDA: Unable to find requested dongle type %x\n",
                           type);
-               goto out;
+               kfree(dongle);
+               dongle = NULL;
+       }
+       if (dongle) {
+               /* Bind the registration info to this particular instance */
+               dongle->issue = reg;
+               dongle->dev = dev;
        }
-
-       /* Allocate dongle info for this instance */
-       dongle = kzalloc(sizeof(dongle_t), GFP_KERNEL);
-       if (!dongle)
-               goto out;
-
-       /* Bind the registration info to this particular instance */
-       dongle->issue = reg;
-       dongle->dev = dev;
-
- out:
        spin_unlock(&dongles->hb_spinlock);
        return dongle;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to