User: | Jiri Slaby |
Error type: | Invalid Pointer Dereference |
Error type description: | A pointer which is invalid is being dereferenced |
File location: | fs/xfs/xfs_da_btree.c |
Line in file: | 2431 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Smatch
(1.59)
|
Entered: | 2013-09-10 07:54:05 UTC |
2401 */ 2402 else if (!(XFS_BUF_ISDONE(bp))) 2403 XFS_BUF_DONE(bp); 2404 } 2405 ASSERT(last < off); 2406} 2407 2408/* 2409 * Release dabuf from a transaction. 2410 * Have to free up the dabuf before the buffers are released, 2411 * since the synchronization on the dabuf is really the lock on the buffer. 2412 */ 2413void 2414xfs_da_brelse(xfs_trans_t *tp, xfs_dabuf_t *dabuf) 2415{ 2416 xfs_buf_t *bp; 2417 xfs_buf_t **bplist; 2418 int i; 2419 int nbuf; 2420 2421 ASSERT(dabuf->nbuf && dabuf->data && dabuf->bbcount && dabuf->bps[0]); 2422 if ((nbuf = dabuf->nbuf) == 1) { 2423 bplist = &bp; 2424 bp = dabuf->bps[0]; 2425 } else { 2426 bplist = kmem_alloc(nbuf * sizeof(*bplist), KM_SLEEP); 2427 memcpy(bplist, dabuf->bps, nbuf * sizeof(*bplist)); 2428 } 2429 xfs_da_buf_done(dabuf); 2430 for (i = 0; i < nbuf; i++) 2431 xfs_trans_brelse(tp, bplist[i]); 2432 if (bplist != &bp) 2433 kmem_free(bplist); 2434} 2435 2436/* 2437 * Invalidate dabuf from a transaction. 2438 */ 2439void 2440xfs_da_binval(xfs_trans_t *tp, xfs_dabuf_t *dabuf) 2441{