Showing error 977

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/netfilter/ipvs/ip_vs_sync.c
Line in file: 209
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

179        if (!(sb=kmalloc(sizeof(struct ip_vs_sync_buff), GFP_ATOMIC)))
180                return NULL;
181
182        if (!(sb->mesg=kmalloc(sync_send_mesg_maxlen, GFP_ATOMIC))) {
183                kfree(sb);
184                return NULL;
185        }
186        sb->mesg->nr_conns = 0;
187        sb->mesg->syncid = ip_vs_master_syncid;
188        sb->mesg->size = 4;
189        sb->head = (unsigned char *)sb->mesg + 4;
190        sb->end = (unsigned char *)sb->mesg + sync_send_mesg_maxlen;
191        sb->firstuse = jiffies;
192        return sb;
193}
194
195static inline void ip_vs_sync_buff_release(struct ip_vs_sync_buff *sb)
196{
197        kfree(sb->mesg);
198        kfree(sb);
199}
200
201static inline void sb_queue_tail(struct ip_vs_sync_buff *sb)
202{
203        spin_lock(&ip_vs_sync_lock);
204        if (ip_vs_sync_state & IP_VS_STATE_MASTER)
205                list_add_tail(&sb->list, &ip_vs_sync_queue);
206        else
207                ip_vs_sync_buff_release(sb);
208        spin_unlock(&ip_vs_sync_lock);
209}
210
211/*
212 *        Get the current sync buffer if it has been created for more
213 *        than the specified time or the specified time is zero.
214 */
215static inline struct ip_vs_sync_buff *
216get_curr_sync_buff(unsigned long time)
217{
218        struct ip_vs_sync_buff *sb;
219
Show full sources