Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit
[firefly-linux-kernel-4.4.55.git] / fs / nfsd / nfsctl.c
index 9506ea5656105adf0598b7b0cb7a3bdf69fd71cc..19ace74d35f6f2ac130cc3d31eab766aafcaccff 100644 (file)
@@ -608,7 +608,7 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
                                       num);
                        sep = " ";
 
-                       if (len > remaining)
+                       if (len >= remaining)
                                break;
                        remaining -= len;
                        buf += len;
@@ -623,7 +623,7 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
                                                '+' : '-',
                                        minor);
 
-                       if (len > remaining)
+                       if (len >= remaining)
                                break;
                        remaining -= len;
                        buf += len;
@@ -631,7 +631,7 @@ static ssize_t __write_versions(struct file *file, char *buf, size_t size)
                }
 
        len = snprintf(buf, remaining, "\n");
-       if (len > remaining)
+       if (len >= remaining)
                return -EINVAL;
        return tlen + len;
 }