]> git.proxmox.com Git - mirror_zfs.git/commit
Fix potential NULL pointer dereference regression
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Thu, 10 Nov 2022 14:01:58 +0000 (09:01 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 10 Nov 2022 21:56:28 +0000 (13:56 -0800)
commit9e2be2dfbde6c41ff53d71f3669cb6b9909c5a40
treee3515f9cba6c4cb0f9b9acf2b9bc2dc8a386851a
parent16f0fdadddcc7562ddf475f496a434b9ac94b0f7
Fix potential NULL pointer dereference regression

945b407486a0072ec7dd117a0bde2f72d52eb445 neglected to `NULL` check
`tx->tx_objset`, which is already done in the function. This upset
Coverity, which complained about a "dereference after null check".

Upon inspection, it was found that whenever `dmu_tx_create_dd()` is
called followed by `dmu_tx_assign()`, such as in
`dsl_sync_task_common()`, `tx->tx_objset` will be `NULL`.

Reported-by: Coverity (CID 1527261)
Reviewed-by: Mariusz Zaborski <mariusz.zaborski@klarasystems.com>
Reviewed-by: Youzhong Yang <yyang@mathworks.com>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14170
module/zfs/dsl_dir.c