lkml.org 
[lkml]   [2002]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.088 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site