Messages in this thread | | | Date | Sat, 25 Mar 2000 11:11:53 +0100 | From | Torben Mathiasen <> | Subject | Re: [PATCH] bugfixes for PPP driver against 2.3.99p3 |
| |
On Sat, Mar 25 2000, Tim Waugh wrote: > On Sat, 25 Mar 2000, Paul Mackerras wrote: > > > @@ -213,26 +174,34 @@ > > ppp_sync_open(struct tty_struct *tty) > > { > > struct syncppp *ap; > > + int err; > > > > ap = kmalloc(sizeof(*ap), GFP_KERNEL); > > if (ap == 0) > > return -ENOMEM; > > > > - MOD_INC_USE_COUNT; > > - > [...] > > + MOD_INC_USE_COUNT; > > return 0; > > } > > Shouldn't the MOD_INC_USE_COUNT be before the kmalloc, with a > MOD_DEC_USE_COUNT on failure cases, for race avoidance? > > Tim.
Kmalloc can sleep, so yes.
-- Torben Mathiasen Linux ThunderLAN maintainer <tmm@image.dk, torben.mathiasen@compaq.com> My opinions are my own and may not reflect those of my employer
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |