Showing error 1568

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: drivers/block/cciss.c
Line in file: 2280
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-05-29 20:11:37 UTC


Source:

2250                *total_size = be64_to_cpu(*(__be64 *) buf->total_size);
2251                *block_size = be32_to_cpu(*(__be32 *) buf->block_size);
2252        } else {                /* read capacity command failed */
2253                printk(KERN_WARNING "cciss: read capacity failed\n");
2254                *total_size = 0;
2255                *block_size = BLOCK_SIZE;
2256        }
2257        printk(KERN_INFO "      blocks= %llu block_size= %d\n",
2258               (unsigned long long)*total_size+1, *block_size);
2259        kfree(buf);
2260}
2261
2262static int cciss_revalidate(struct gendisk *disk)
2263{
2264        ctlr_info_t *h = get_host(disk);
2265        drive_info_struct *drv = get_drv(disk);
2266        int logvol;
2267        int FOUND = 0;
2268        unsigned int block_size;
2269        sector_t total_size;
2270        InquiryData_struct *inq_buff = NULL;
2271
2272        for (logvol = 0; logvol < CISS_MAX_LUN; logvol++) {
2273                if (h->drv[logvol].LunID == drv->LunID) {
2274                        FOUND = 1;
2275                        break;
2276                }
2277        }
2278
2279        if (!FOUND)
2280                return 1;
2281
2282        inq_buff = kmalloc(sizeof(InquiryData_struct), GFP_KERNEL);
2283        if (inq_buff == NULL) {
2284                printk(KERN_WARNING "cciss: out of memory\n");
2285                return 1;
2286        }
2287        if (h->cciss_read == CCISS_READ_10) {
2288                cciss_read_capacity(h->ctlr, logvol, 1,
2289                                        &total_size, &block_size);
2290        } else {
Show full sources