svn commit: r351877 - stable/12/sys/fs/nandfs
Ian Lepore
ian at FreeBSD.org
Thu Sep 5 17:20:49 UTC 2019
Author: ian
Date: Thu Sep 5 17:20:48 2019
New Revision: 351877
URL: https://svnweb.freebsd.org/changeset/base/351877
Log:
Fix LINT kernel builds on powerpc64 and sparc64. This is a direct commit
to 12-stable because the nandfs code no longer exists in 13-current.
The build was failing with
nandfs_dat.c:301:
warning: comparison is always false due to limited range of data type
I tried to fix it with an inline (size_t) cast of nargv->nv_nmembs in the
if() expression, but that didn't help (which seems a bit buggy), but using
an intermediate variable fixed it. Elegance doesn't matter as much as
suppressing the warning; this code is long-dead even on this branch.
Modified:
stable/12/sys/fs/nandfs/nandfs_dat.c
Modified: stable/12/sys/fs/nandfs/nandfs_dat.c
==============================================================================
--- stable/12/sys/fs/nandfs/nandfs_dat.c Thu Sep 5 17:20:24 2019 (r351876)
+++ stable/12/sys/fs/nandfs/nandfs_dat.c Thu Sep 5 17:20:48 2019 (r351877)
@@ -295,10 +295,11 @@ nandfs_get_dat_bdescs_ioctl(struct nandfs_device *nffs
struct nandfs_argv *nargv)
{
struct nandfs_bdesc *bd;
- size_t size;
+ size_t size, sizecheck;
int error;
- if (nargv->nv_nmembs >= SIZE_MAX / sizeof(struct nandfs_bdesc))
+ sizecheck = nargv->nv_nmembs;
+ if (sizecheck >= SIZE_MAX / sizeof(struct nandfs_bdesc))
return (EINVAL);
size = nargv->nv_nmembs * sizeof(struct nandfs_bdesc);
More information about the svn-src-stable-12
mailing list