[lkml]   [2003]   [Apr]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [Bluetooth] HCI USB driver update. Support for SCO over HCI USB.
    On Tue, Apr 29, 2003 at 11:34:19PM +0200, Oliver Neukum wrote:
    > > +int usb_init_urb(struct urb *urb)
    > > +{
    > > + if (!urb)
    > > + return -EINVAL;
    > > + memset(urb, 0, sizeof(*urb));
    > > + urb->count = (atomic_t)ATOMIC_INIT(1);
    > > + spin_lock_init(&urb->lock);
    > > +
    > > + return 0;
    > > +}
    > Greg, please don't do it this way. Somebody will
    > try to free this urb. If the urb is part of a structure
    > this must not lead to a kfree. Please init it to some
    > insanely high dummy value in this case.

    We can't init it to a high value, if we want to use it ourself in

    And yes, I agree this is a very dangerous function to use on your own,
    I thought I conveyed that in the documentation for the function.

    But if we don't have such a function, then people like Max will just
    roll their own, like he just did :)

    Might as well make it easy for him to shoot himself in the foot if he
    really wants to...


    greg k-h
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:35    [W:0.019 / U:93.580 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site