mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
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
This commit is contained in:
committed by
Brian Behlendorf
parent
3cb293a6f8
commit
47b994049f
@@ -2808,7 +2808,7 @@ nvs_native_create(nvstream_t *nvs, nvs_native_t *native, char *buf,
|
||||
static void
|
||||
nvs_native_destroy(nvstream_t *nvs)
|
||||
{
|
||||
(void) nvs;
|
||||
nvs->nvs_private = NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -3189,7 +3189,7 @@ nvs_xdr_destroy(nvstream_t *nvs)
|
||||
switch (nvs->nvs_op) {
|
||||
case NVS_OP_ENCODE:
|
||||
case NVS_OP_DECODE:
|
||||
xdr_destroy((XDR *)nvs->nvs_private);
|
||||
nvs->nvs_private = NULL;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user