summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe Di Natale <[email protected]>2017-03-09 17:40:21 -0800
committerBrian Behlendorf <[email protected]>2017-03-09 17:40:21 -0800
commit589bb918ef39058b1f06da72092e895835a7aaff (patch)
treebc5cdc05e6f334fef7b20e2d6ec53fcb9bd7c605
parentc3d043817305efebce89db5d9146e70807c4043b (diff)
Suppress cppcheck nullPointer error in zfs_write
Newer versions of cppcheck find the potential NULL pointer bug in zfs_write(). The function is difficult to refactor without extensive work, so suppress the potential NULL pointer error which cannot occur for now. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Giuseppe Di Natale <[email protected]> Closes #5882
-rw-r--r--Makefile.am3
-rw-r--r--module/zfs/zfs_vnops.c1
2 files changed, 3 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 2cd2aabc5..3adc161ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -62,7 +62,8 @@ lint: cppcheck paxcheck
cppcheck:
@if type cppcheck > /dev/null 2>&1; then \
- cppcheck --quiet --force --error-exitcode=2 ${top_srcdir}; \
+ cppcheck --inline-suppr --quiet --force --error-exitcode=2 \
+ ${top_srcdir}; \
fi
paxcheck:
diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
index 2e5099574..502e8f4a2 100644
--- a/module/zfs/zfs_vnops.c
+++ b/module/zfs/zfs_vnops.c
@@ -829,6 +829,7 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
aiov->iov_base != abuf->b_data)) {
ASSERT(xuio);
dmu_write(zsb->z_os, zp->z_id, woff,
+ // cppcheck-suppress nullPointer
aiov->iov_len, aiov->iov_base, tx);
dmu_return_arcbuf(abuf);
xuio_stat_wbuf_copied();