Suppress static analyzer warning in sa_attr_iter()
commit7fc48f8378c608bde79e815f8a3e95a4f2045314
authorRichard Yao <richard.yao@alumni.stonybrook.edu>
Tue, 7 Feb 2023 08:02:10 +0000 (7 03:02 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 1 Mar 2023 01:31:30 +0000 (28 17:31 -0800)
treed352eed28e4549c5e215f3f1f33f97ec14250d17
parent4d9bb5514c5ab1b025384db3f3c42eca550ff944
Suppress static analyzer warning in sa_attr_iter()

Clang's static analyzer points out that when IS_SA_BONUSTYPE(type) is
true and .sa_length is 0 for an attribute, we have a NULL pointer
dereference. We suppress this with an IMPLY() statement.

This was also identified by Coverity.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Brian Atkinson <batkinson@lanl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Reported-by: Coverity (CID-1017954)
Closes #14470
module/zfs/sa.c