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 <behlendorf1@llnl.gov>
Signed-off-by: Giuseppe Di Natale <dinatale2@llnl.gov>
Closes #5882
This commit is contained in:
Giuseppe Di Natale 2017-03-09 17:40:21 -08:00 committed by Brian Behlendorf
parent c3d0438173
commit 589bb918ef
2 changed files with 3 additions and 1 deletions

View File

@ -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:

View File

@ -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();