Locking in ng_tty.c

Martin Birgmeier la5lbtyi at aon.at
Sat Feb 19 20:31:07 UTC 2011


In ng_tty.c, function ngt_newhook(), there is the following code:

         if (sc->hook)
                 return (EISCONN);

         NGTLOCK(sc);
         sc->hook = hook;
         NGTUNLOCK(sc);

I do not think this is proper - should not the test be within the lock?

Regards,

Martin

-- 
Martin Birgmeier
Vienna
Austria


More information about the freebsd-net mailing list