[PATCH] uml: activate_fd: return ENOMEM only when appropriate
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Thu, 8 Mar 2007 04:41:13 +0000 (20:41 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 8 Mar 2007 15:38:21 +0000 (07:38 -0800)
Avoid returning ENOMEM in case of a duplicate IRQ - ENOMEM was saved into err
earlier.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Acked-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/um/kernel/irq.c

index 50a288bb875a87ec10e977db3f366358c15d29d8..dbf2f5bc842f69d08026174ad6d00792c8e9b0f1 100644 (file)
@@ -142,6 +142,7 @@ int activate_fd(int irq, int fd, int type, void *dev_id)
                                     .events            = events,
                                     .current_events    = 0 } );
 
+       err = -EBUSY;
        spin_lock_irqsave(&irq_lock, flags);
        for (irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next) {
                if ((irq_fd->fd == fd) && (irq_fd->type == type)) {