[PATCH] bpqether add rcu_read_lock

From: Stephen Hemminger (oup.vvoon@ortelco.net)
Date: Wed Aug 13 2003 - 01:33:12 EEST

  • Next message: Stephen Hemminger: "[PATCH] ax25 fix for premature free."

    Fix one comment and add rcu_read_lock/rcu_read_unlock in the net_device_notifier.
    Preemption is almost certainly already disabled there, but be safe.

    diff -Nru a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
    --- a/drivers/net/hamradio/bpqether.c Tue Aug 12 11:37:28 2003
    +++ b/drivers/net/hamradio/bpqether.c Tue Aug 12 11:37:28 2003
    @@ -141,7 +141,6 @@
     
     /*
      * Get the BPQ device for the ethernet device
    - * need to hold bqp_lock at least for read
      */
     static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev)
     {
    @@ -564,6 +563,8 @@
             if (!dev_is_ethdev(dev))
                     return NOTIFY_DONE;
     
    + rcu_read_lock();
    +
             switch (event) {
             case NETDEV_UP: /* new ethernet device -> new BPQ interface */
                     if (bpq_get_ax25_dev(dev) == NULL)
    @@ -582,6 +583,7 @@
             default:
                     break;
             }
    + rcu_read_unlock();
     
             return NOTIFY_DONE;
     }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-hams" in
    the body of a message to qtkfbz.xjvtyl@host106-99.crowley.pl
    More majordomo info at http://vger.kernel.org/majordomo-info.html



    This archive was generated by hypermail 2b30 : Wed Aug 13 2003 - 01:37:27 EEST