]> granicus.if.org Git - zfs/commitdiff
Fix coverity defects: CID 147553
authorcao <cao.xuewen@zte.com.cn>
Tue, 1 Nov 2016 17:20:24 +0000 (01:20 +0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 1 Nov 2016 17:20:24 +0000 (10:20 -0700)
CID 147553: Type:Dereference null return value

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: cao.xuewen <cao.xuewen@zte.com.cn>
Closes #5305

module/zfs/dmu_tx.c

index d8bd7cb787ba15d8309673e407c6d6c6bfbc5929..3ee9468854d012a35f6bdd68eb6c785ac2ea319b 100644 (file)
@@ -1249,7 +1249,8 @@ dmu_tx_unassign(dmu_tx_t *tx)
         * Walk the transaction's hold list, removing the hold on the
         * associated dnode, and notifying waiters if the refcount drops to 0.
         */
-       for (txh = list_head(&tx->tx_holds); txh != tx->tx_needassign_txh;
+       for (txh = list_head(&tx->tx_holds);
+           txh && txh != tx->tx_needassign_txh;
            txh = list_next(&tx->tx_holds, txh)) {
                dnode_t *dn = txh->txh_dnode;