Re: [PATCH] bugfixes for PPP driver against 2.3.99p3

From: Torben Mathiasen (tmm@image.dk)
Date: Sat Mar 25 2000 - 05:11:53 EST

  • Next message: Ganesh Sittampalam: "Re: 2.3.99-pre3 ipv4 modules crash"

    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/



    This archive was generated by hypermail 2b29 : Sat Mar 25 2000 - 05:14:42 EST