diff options
author | Brian Behlendorf <[email protected]> | 2022-06-20 21:32:03 +0000 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2022-06-27 14:19:19 -0700 |
commit | 9619bcdefb0dff38e36f8c89d9e2980112105cbb (patch) | |
tree | 72b0b7bd1098958aa25129294a71dc0d5435f7b3 | |
parent | ff7e405f83fbfcd763c4b7ed8b68258227765731 (diff) |
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 <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #13528
Closes #13575
-rw-r--r-- | module/zfs/dbuf.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/module/zfs/dbuf.c b/module/zfs/dbuf.c index 55a3686fa..71b2b0992 100644 --- a/module/zfs/dbuf.c +++ b/module/zfs/dbuf.c @@ -3199,9 +3199,10 @@ dbuf_issue_final_prefetch_done(zio_t *zio, const zbookmark_phys_t *zb, (void) zio, (void) zb, (void) iobp; dbuf_prefetch_arg_t *dpa = private; - dbuf_prefetch_fini(dpa, B_TRUE); if (abuf != NULL) arc_buf_destroy(abuf, private); + + dbuf_prefetch_fini(dpa, B_TRUE); } /* |