Showing error 1060

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/atm/lec.c
Line in file: 1087
Project: Linux Kernel
Project version: 2.6.28
Tools: Undetermined 1
Entered: 2012-03-04 17:07:06 UTC


Source:

1057        struct hlist_head *lec_misc_tables[] = {
1058                &priv->lec_arp_empty_ones,
1059                &priv->lec_no_forward,
1060                &priv->mcast_fwds
1061        };
1062        void *v = NULL;
1063        int q;
1064
1065        for (q = state->misc_table; q < ARRAY_SIZE(lec_misc_tables); q++) {
1066                v = lec_tbl_walk(state, lec_misc_tables[q], l);
1067                if (v)
1068                        break;
1069        }
1070        state->misc_table = q;
1071        return v;
1072}
1073
1074static void *lec_priv_walk(struct lec_state *state, loff_t *l,
1075                           struct lec_priv *priv)
1076{
1077        if (!state->locked) {
1078                state->locked = priv;
1079                spin_lock_irqsave(&priv->lec_arp_lock, state->flags);
1080        }
1081        if (!lec_arp_walk(state, l, priv) && !lec_misc_walk(state, l, priv)) {
1082                spin_unlock_irqrestore(&priv->lec_arp_lock, state->flags);
1083                state->locked = NULL;
1084                /* Partial state reset for the next time we get called */
1085                state->arp_table = state->misc_table = 0;
1086        }
1087        return state->locked;
1088}
1089
1090static void *lec_itf_walk(struct lec_state *state, loff_t *l)
1091{
1092        struct net_device *dev;
1093        void *v;
1094
1095        dev = state->dev ? state->dev : dev_lec[state->itf];
1096        v = (dev && dev->priv) ? lec_priv_walk(state, l, dev->priv) : NULL;
1097        if (!v && dev) {
Show full sources