Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c8ea5ae authored by Andrew Morton's avatar Andrew Morton Committed by David S. Miller
Browse files

[IRDA] irda_device_dongle_init: fix kzalloc(GFP_KERNEL) in spinlock

parent 14690fc6
Loading
Loading
Loading
Loading
+8 −13
Original line number Diff line number Diff line
@@ -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;
	}

	/* Allocate dongle info for this instance */
	dongle = kzalloc(sizeof(dongle_t), GFP_KERNEL);
	if (!dongle)
		goto out;

	if (dongle) {
		/* Bind the registration info to this particular instance */
		dongle->issue = reg;
		dongle->dev = dev;

 out:
	}
	spin_unlock(&dongles->hb_spinlock);
	return dongle;
}