HomeFreeBSD

Fix potential NULL pointer dereference regression

Description

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

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Nov 10 2022, 2:01 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Nov 10 2022, 9:56 PM
Parents
rG16f0fdadddcc: Allow to control failfast
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG9e2be2dfbde6: Fix potential NULL pointer dereference regression (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Nov 10 2022, 9:56 PM