]> granicus.if.org Git - zfs/commitdiff
Fix coverity defects: CID 176037
authorTom Caputi <tcaputi@datto.com>
Mon, 2 Jul 2018 20:37:48 +0000 (16:37 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 2 Jul 2018 20:37:48 +0000 (13:37 -0700)
CID 176037: Uninitialized scalar variable

This patch fixes an uninitialized variable defect caught by
coverity and introduced in 69830602

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #7667

module/zfs/dbuf.c

index 0a8e6d08b3076b99aa9827b544fee87ff5e7daa1..49e23e1d78de2f3e6a22b263a9b470ae85f2d9cb 100644 (file)
@@ -1263,6 +1263,10 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
                return (0);
        }
 
+
+       SET_BOOKMARK(&zb, dmu_objset_id(db->db_objset),
+           db->db.db_object, db->db_level, db->db_blkid);
+
        /*
         * All bps of an encrypted os should have the encryption bit set.
         * If this is not true it indicates tampering and we report an error.
@@ -1293,9 +1297,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t *zio, uint32_t flags)
 
        dbuf_add_ref(db, NULL);
 
-       SET_BOOKMARK(&zb, dmu_objset_id(db->db_objset),
-           db->db.db_object, db->db_level, db->db_blkid);
-
        zio_flags = (flags & DB_RF_CANFAIL) ?
            ZIO_FLAG_CANFAIL : ZIO_FLAG_MUSTSUCCEED;