Showing error 1368

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: fs/ubifs/compress.c
Line in file: 128
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-21 20:30:05 UTC


Source:

 98        int err;
 99        struct ubifs_compressor *compr = ubifs_compressors[*compr_type];
100
101        if (*compr_type == UBIFS_COMPR_NONE)
102                goto no_compr;
103
104        /* If the input data is small, do not even try to compress it */
105        if (in_len < UBIFS_MIN_COMPR_LEN)
106                goto no_compr;
107
108        if (compr->comp_mutex)
109                mutex_lock(compr->comp_mutex);
110        err = crypto_comp_compress(compr->cc, in_buf, in_len, out_buf,
111                                   out_len);
112        if (compr->comp_mutex)
113                mutex_unlock(compr->comp_mutex);
114        if (unlikely(err)) {
115                ubifs_warn("cannot compress %d bytes, compressor %s, "
116                           "error %d, leave data uncompressed",
117                           in_len, compr->name, err);
118                 goto no_compr;
119        }
120
121        /*
122         * Presently, we just require that compression results in less data,
123         * rather than any defined minimum compression ratio or amount.
124         */
125        if (ALIGN(*out_len, 8) >= ALIGN(in_len, 8))
126                goto no_compr;
127
128        return;
129
130no_compr:
131        memcpy(out_buf, in_buf, in_len);
132        *out_len = in_len;
133        *compr_type = UBIFS_COMPR_NONE;
134}
135
136/**
137 * ubifs_decompress - decompress data.
138 * @in_buf: data to decompress
Show full sources