Fix -Wuse-after-free warning in dbuf_destroy()
commitc175f5ebb2f4910e2d4f38f794e3973e53baa94e
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 20 Jun 2022 21:35:38 +0000 (20 21:35 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 27 Jun 2022 21:19:24 +0000 (27 14:19 -0700)
treea47671978868eaabe5ff427ce5876586dd7df391
parent9619bcdefb0dff38e36f8c89d9e2980112105cbb
Fix -Wuse-after-free warning in dbuf_destroy()

Move the use of the db pointer after it is freed.  It's only used as
a tag so a dereference would never occur, but there's no reason we
can't invert the order to resolve the warning.

    module/zfs/dbuf.c: In function 'dbuf_destroy':
    module/zfs/dbuf.c:2953:17: error:
    pointer 'db' may be used after 'free' [-Werror=use-after-free]

Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #13528
Closes #13575
module/zfs/dbuf.c