]> git.proxmox.com Git - mirror_zfs.git/commit
Silence clang static analyzer warnings about stored stack addresses
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Sat, 11 Mar 2023 18:17:59 +0000 (13:17 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 14 Mar 2023 22:25:01 +0000 (15:25 -0700)
commit47b994049fd105f54a887e19ec0669e9084b7cf2
treed26358ffe667541f0e336bb5b7c26f79dfb0a6c4
parent3cb293a6f803fe9ef58a6b6d23d50ca5b688da97
Silence clang static analyzer warnings about stored stack addresses

Clang's static analyzer complains that nvs_xdr() and nvs_native()
functions return pointers to stack memory. That is technically true, but
the pointers are stored in stack memory from the caller's stack frame,
are not read by the caller and are deallocated when the caller returns,
so this is harmless. We set the pointers to NULL to silence the
warnings.

Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14612
include/os/linux/spl/rpc/xdr.h
module/nvpair/nvpair.c