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

Commit d4c63b7c authored by Paul Fulghum's avatar Paul Fulghum Committed by Linus Torvalds
Browse files

synclink_gt fix module reference



Get module reference on open() by generic HDLC to prevent module from
unloading while interface is active.

Signed-off-by: default avatarPaul Fulghum <paulkf@microgate.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1807a1aa
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1565,6 +1565,9 @@ static int hdlcdev_open(struct net_device *dev)
	int rc;
	int rc;
	unsigned long flags;
	unsigned long flags;


	if (!try_module_get(THIS_MODULE))
		return -EBUSY;

	DBGINFO(("%s hdlcdev_open\n", dev->name));
	DBGINFO(("%s hdlcdev_open\n", dev->name));


	/* generic HDLC layer open processing */
	/* generic HDLC layer open processing */
@@ -1634,6 +1637,7 @@ static int hdlcdev_close(struct net_device *dev)
	info->netcount=0;
	info->netcount=0;
	spin_unlock_irqrestore(&info->netlock, flags);
	spin_unlock_irqrestore(&info->netlock, flags);


	module_put(THIS_MODULE);
	return 0;
	return 0;
}
}