Showing error 937

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


Source:

688                tocopy = sb->s_blocksize - offset < towrite ?
689                                sb->s_blocksize - offset : towrite;
690
691                tmp_bh.b_state = 0;
692                tmp_bh.b_size = 1 << inode->i_blkbits;
693                err = jfs_get_block(inode, blk, &tmp_bh, 1);
694                if (err)
695                        goto out;
696                if (offset || tocopy != sb->s_blocksize)
697                        bh = sb_bread(sb, tmp_bh.b_blocknr);
698                else
699                        bh = sb_getblk(sb, tmp_bh.b_blocknr);
700                if (!bh) {
701                        err = -EIO;
702                        goto out;
703                }
704                lock_buffer(bh);
705                memcpy(bh->b_data+offset, data, tocopy);
706                flush_dcache_page(bh->b_page);
707                set_buffer_uptodate(bh);
708                mark_buffer_dirty(bh);
709                unlock_buffer(bh);
710                brelse(bh);
711                offset = 0;
712                towrite -= tocopy;
713                data += tocopy;
714                blk++;
715        }
716out:
717        if (len == towrite)
718                return err;
719        if (inode->i_size < off+len-towrite)
720                i_size_write(inode, off+len-towrite);
721        inode->i_version++;
722        inode->i_mtime = inode->i_ctime = CURRENT_TIME;
723        mark_inode_dirty(inode);
724        mutex_unlock(&inode->i_mutex);
725        return len - towrite;
726}
727
728#endif
Show full sources