Ignore:
Timestamp:
Apr 16, 2017, 3:07:01 PM (4 months ago)
Author:
brainslayer
Message:

update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/linux/universal/linux-3.18/net/can/af_can.c

    r27594 r31869  
    447447 * @data: returned parameter for callback function
    448448 * @ident: string for calling module identification
     449 * @sk: socket pointer (might be NULL)
    449450 *
    450451 * Description:
     
    470471int can_rx_register(struct net_device *dev, canid_t can_id, canid_t mask,
    471472                    void (*func)(struct sk_buff *, void *), void *data,
    472                     char *ident)
     473                    char *ident, struct sock *sk)
    473474{
    474475        struct receiver *r;
     
    498499                r->data    = data;
    499500                r->ident   = ident;
     501                r->sk      = sk;
    500502
    501503                hlist_add_head_rcu(&r->list, rl);
     
    522524{
    523525        struct receiver *r = container_of(rp, struct receiver, rcu);
     526        struct sock *sk = r->sk;
    524527
    525528        kmem_cache_free(rcv_cache, r);
     529        if (sk)
     530                sock_put(sk);
    526531}
    527532
     
    598603
    599604        /* schedule the receiver item for deletion */
    600         if (r)
     605        if (r) {
     606                if (r->sk)
     607                        sock_hold(r->sk);
    601608                call_rcu(&r->rcu, can_rx_delete_receiver);
     609        }
    602610}
    603611EXPORT_SYMBOL(can_rx_unregister);
Note: See TracChangeset for help on using the changeset viewer.