Showing error 934

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/floppy.c
Line in file: 3327
Project: Linux Kernel
Project version: 2.6.28
Confirmation: Fixed by 8516a500029890a72622d245f8ed32c4e30969b7
Tools: Stanse (1.2)
Entered: 2012-03-02 21:35:17 UTC


Source:

3297                ret = ret2;
3298        raw_cmd_free(&my_raw_cmd);
3299        return ret;
3300}
3301
3302static int invalidate_drive(struct block_device *bdev)
3303{
3304        /* invalidate the buffer track to force a reread */
3305        set_bit((long)bdev->bd_disk->private_data, &fake_change);
3306        process_fd_request();
3307        check_disk_change(bdev);
3308        return 0;
3309}
3310
3311static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
3312                               int drive, int type, struct block_device *bdev)
3313{
3314        int cnt;
3315
3316        /* sanity checking for parameters. */
3317        if (g->sect <= 0 ||
3318            g->head <= 0 ||
3319            g->track <= 0 || g->track > UDP->tracks >> STRETCH(g) ||
3320            /* check if reserved bits are set */
3321            (g->stretch & ~(FD_STRETCH | FD_SWAPSIDES | FD_SECTBASEMASK)) != 0)
3322                return -EINVAL;
3323        if (type) {
3324                if (!capable(CAP_SYS_ADMIN))
3325                        return -EPERM;
3326                mutex_lock(&open_lock);
3327                LOCK_FDC(drive, 1);
3328                floppy_type[type] = *g;
3329                floppy_type[type].name = "user format";
3330                for (cnt = type << 2; cnt < (type << 2) + 4; cnt++)
3331                        floppy_sizes[cnt] = floppy_sizes[cnt + 0x80] =
3332                            floppy_type[type].size + 1;
3333                process_fd_request();
3334                for (cnt = 0; cnt < N_DRIVE; cnt++) {
3335                        struct block_device *bdev = opened_bdev[cnt];
3336                        if (!bdev || ITYPE(drive_state[cnt].fd_device) != type)
3337                                continue;
Show full sources