mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
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
This commit is contained in:
parent
fe20400db5
commit
070402f112
@ -1559,6 +1559,7 @@ dnode_hold_impl(objset_t *os, uint64_t object, int flag, int slots,
|
||||
dnode_slots_rele(dnc, idx, slots);
|
||||
|
||||
DNODE_VERIFY(dn);
|
||||
ASSERT3P(dnp, !=, NULL);
|
||||
ASSERT3P(dn->dn_dbuf, ==, db);
|
||||
ASSERT3U(dn->dn_object, ==, object);
|
||||
dbuf_rele(db, FTAG);
|
||||
|
Loading…
Reference in New Issue
Block a user