Merge branch 'perf-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / drivers / staging / lustre / lustre / libcfs / linux / linux-module.c
index a5effcd9c6794b6197cd4260b561e7308a794614..e962f89683a60cdb68ee67b3070bc185d783027e 100644 (file)
@@ -57,7 +57,7 @@ int libcfs_ioctl_getdata(char *buf, char *end, void *arg)
                return -EINVAL;
        }
 
-       if (hdr->ioc_len + buf >= end) {
+       if (hdr->ioc_len >= end - buf) {
                CERROR("PORTALS: user buffer exceeds kernel buffer\n");
                return -EINVAL;
        }