Re: [PATCH] ATM locking fix. [Re: [PATCH] spinlock not locked when unlocking in atm_dev_register]

From: Francois Romieu (romieu@cogenit.fr)
Date: Sat Mar 09 2002 - 13:45:15 EST


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/



This archive was generated by hypermail 2b29 : Fri Mar 15 2002 - 22:00:12 EST