Showing error 1467

User: Jiri Slaby
Error type: Leaving function in locked state
Error type description: Some lock is not unlocked on all paths of a function, so it is leaked
File location: net/core/gen_stats.c
Line in file: 72
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

 42 * @tc_stats_type: TLV type for backward compatibility struct tc_stats TLV
 43 * @xstats_type: TLV type for backward compatibility xstats TLV
 44 * @lock: statistics lock
 45 * @d: dumping handle
 46 *
 47 * Initializes the dumping handle, grabs the statistic lock and appends
 48 * an empty TLV header to the socket buffer for use a container for all
 49 * other statistic TLVS.
 50 *
 51 * The dumping handle is marked to be in backward compatibility mode telling
 52 * all gnet_stats_copy_XXX() functions to fill a local copy of struct tc_stats.
 53 *
 54 * Returns 0 on success or -1 if the room in the socket buffer was not sufficient.
 55 */
 56int
 57gnet_stats_start_copy_compat(struct sk_buff *skb, int type, int tc_stats_type,
 58        int xstats_type, spinlock_t *lock, struct gnet_dump *d)
 59        __acquires(lock)
 60{
 61        memset(d, 0, sizeof(*d));
 62
 63        spin_lock_bh(lock);
 64        d->lock = lock;
 65        if (type)
 66                d->tail = (struct nlattr *)skb_tail_pointer(skb);
 67        d->skb = skb;
 68        d->compat_tc_stats = tc_stats_type;
 69        d->compat_xstats = xstats_type;
 70
 71        if (d->tail)
 72                return gnet_stats_copy(d, type, NULL, 0);
 73
 74        return 0;
 75}
 76
 77/**
 78 * gnet_stats_start_copy_compat - start dumping procedure in compatibility mode
 79 * @skb: socket buffer to put statistics TLVs into
 80 * @type: TLV type for top level statistic TLV
 81 * @lock: statistics lock
 82 * @d: dumping handle
Show full sources