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]
Message-ID: <kjNEPme1.1177575167.3331050.samuel@sortiz.org>
Date:	26 Apr 2007 08:12:47 -0000
From:	"Samuel Ortiz" <samuel@...tiz.org>
To:	akpm@...ux-foundation.org, davem@...emloft.net
CC:	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"matthias.kaehlcke@...il.com" <matthias.kaehlcke@...il.com>
Subject: Re: [patch 13/15] irda_device_dongle_init: fix kzalloc(GFP_KERNEL) in spinlock


On 4/26/2007, "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>
wrote:

>From: Andrew Morton <akpm@...ux-foundation.org>
>
>Fix http://bugzilla.kernel.org/show_bug.cgi?id=8343
>
>Cc: Samuel Ortiz <samuel@...tiz.org>
>Cc: <matthias.kaehlcke@...il.com>
>Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
This one was on my pipeline, looks good to me.

Signed-off-by: Samuel Ortiz <samuel@...tiz.org>


>---
>
> net/irda/irda_device.c |   21 ++++++++-------------
> 1 file changed, 8 insertions(+), 13 deletions(-)
>
>diff -puN net/irda/irda_device.c~irda_device_dongle_init-fix-kzallocgfp_kernel-in-spinlock net/irda/irda_device.c
>--- a/net/irda/irda_device.c~irda_device_dongle_init-fix-kzallocgfp_kernel-in-spinlock
>+++ a/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
> 	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 netdev" in
>the body of a message to majordomo@...r.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ