diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c index 083dbbb0c..ec6217a2c 100644 --- a/fs/jfs/jfs_txnmgr.c +++ b/fs/jfs/jfs_txnmgr.c @@ -295,7 +295,7 @@ int txInit(void) * tlock id = 0 is reserved. */ size = sizeof(struct tlock) * nTxLock; - TxLock = vmalloc(size); + TxLock = vzalloc(size); if (TxLock == NULL) { vfree(TxBlock); return -ENOMEM; @@ -660,7 +660,10 @@ struct tlock *txLock(tid_t tid, struct inode *ip, struct metapage * mp, for (last = jfs_ip->atlhead; lid_to_tlock(last)->next != lid; last = lid_to_tlock(last)->next) { - assert(last); + if (!last) { + jfs_err("txLock: lid %d not found in atl list", lid); + goto grantLock; + } } lid_to_tlock(last)->next = tlck->next; if (jfs_ip->atltail == lid)