HomeFreeBSD

Fix -Wuse-after-free warning in dbuf_issue_final_prefetch_done()

Description

Fix -Wuse-after-free warning in dbuf_issue_final_prefetch_done()

Move the use of the private pointer after it is freed. It's only
used as a tag so a dereference would never occur, but there's no
harm in inverting the order to resolve the warning.

module/zfs/dbuf.c: In function 'dbuf_issue_final_prefetch_done':
module/zfs/dbuf.c:3204:17: error:
pointer 'private' 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

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jun 20 2022, 9:32 PM
Parents
rGff7e405f83fb: Fix -Wattribute-warning in dsl layer
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG9619bcdefb0d: Fix -Wuse-after-free warning in dbuf_issue_final_prefetch_done() (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jun 27 2022, 9:19 PM