Messages in this thread | | | Date | Sat, 9 Mar 2002 19:45:15 +0100 | From | Francois Romieu <> | Subject | Re: [PATCH] ATM locking fix. [Re: [PATCH] spinlock not locked when unlocking in atm_dev_register] |
| |
Greetings,
Maksim Krasnyanskiy <maxk@qualcomm.com> : > --- linux/net/atm/resources.c.orig Thu Mar 7 13:56:00 2002 > +++ linux/net/atm/resources.c Thu Mar 7 13:56:40 2002 [...] > if (atm_proc_dev_register(dev) < 0) { > printk(KERN_ERR "atm_dev_register: " > "atm_proc_dev_register failed for dev %s\n",type); > - spin_unlock (&atm_dev_lock); > free_atm_dev(dev); <====== (A) > - return NULL; > + goto done; > } > #endif > - spin_unlock (&atm_dev_lock); > + > +done: > + spin_unlock(&atm_dev_lock); > return dev; <====== (B) > }
- dev = NULL is to be inserted between (A) and (B) or the caller won't notice the failure - atm_proc_dev_register issues kmalloc(...,GFP_KERNEL) and atm_dev_lock is hold
-- Ueimor - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |