[PATCH] ax25 use dev_hold/dev_put as required for net_devices.

From: Stephen Hemminger (xahbqn.cwkkw@flowserve.com)
Date: Wed Aug 13 2003 - 02:49:40 EEST

  • Next message: Stephen Hemminger: "[PATCH] ax25 setsockopt(SO_BINDTODEVICE) bug fix"

    Ax25 holds a reference to the net device below, in the ax25_dev structure;
    therefore it needs to use dev_hold/dev_put.

    This is against 2.6.0-test3 with your earlier patch

    diff -Nru a/net/ax25/ax25_dev.c b/net/ax25/ax25_dev.c
    --- a/net/ax25/ax25_dev.c Tue Aug 12 16:45:51 2003
    +++ b/net/ax25/ax25_dev.c Tue Aug 12 16:45:51 2003
    @@ -67,6 +67,7 @@
     
             dev->ax25_ptr = ax25_dev;
             ax25_dev->dev = dev;
    + dev_hold(dev);
             ax25_dev->forward = NULL;
     
             ax25_dev->values[AX25_VALUES_IPDEFMODE] = AX25_DEF_IPDEFMODE;
    @@ -121,6 +122,7 @@
             if ((s = ax25_dev_list) == ax25_dev) {
                     ax25_dev_list = s->next;
                     spin_unlock_bh(&ax25_dev_lock);
    + dev_put(dev);
                     kfree(ax25_dev);
                     ax25_register_sysctl();
                     return;
    @@ -131,6 +133,7 @@
                             s->next = ax25_dev->next;
                             spin_unlock_bh(&ax25_dev_lock);
                             kfree(ax25_dev);
    + dev_put(dev);
                             ax25_register_sysctl();
                             return;
                     }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to qzg@kollmorgen.com
    More majordomo info at http://vger.kernel.org/majordomo-info.html



    This archive was generated by hypermail 2b30 : Wed Aug 13 2003 - 02:50:19 EEST