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

Commit 0f97869d authored by Paolo 'Blaisorblade' Giarrusso's avatar Paolo 'Blaisorblade' Giarrusso Committed by Linus Torvalds
Browse files

[PATCH] uml: activate_fd: return ENOMEM only when appropriate



Avoid returning ENOMEM in case of a duplicate IRQ - ENOMEM was saved into err
earlier.

Signed-off-by: default avatarPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: default avatarJeff Dike <jdike@addtoit.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ec0ac8ad
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -142,6 +142,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
				     .events 		= events,
				     .events 		= events,
				     .current_events 	= 0 } );
				     .current_events 	= 0 } );


	err = -EBUSY;
	spin_lock_irqsave(&irq_lock, flags);
	spin_lock_irqsave(&irq_lock, flags);
	for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
	for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
		if ((irq_fd->fd == fd) && (irq_fd->type == type)) {
		if ((irq_fd->fd == fd) && (irq_fd->type == type)) {