HomeFreeBSD

cppcheck: (warning) Possible null pointer dereference: dnp

Description

cppcheck: (warning) Possible null pointer dereference: dnp

The dnp argument can only be set to NULL when the DNODE_DRY_RUN flag
is set. In which case, an early return path will be executed and a
NULL pointer dereference at the given location is impossible. Add
an additional ASSERT to silence the cppcheck warning and document
that dbp must never be NULL at the point in the function.

[module/zfs/dnode.c:1566]: (warning) Possible null pointer deref: dnp

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9732

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Dec 16 2019, 6:55 PM
Parents
rGfe20400db556: cppcheck: (error) Memory leak: vtoc
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG070402f112bc: cppcheck: (warning) Possible null pointer dereference: dnp (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Dec 19 2019, 1:25 AM