summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/seq_file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/seq_file.c b/fs/seq_file.c
index 368bfb92b115..3ade39e02bb7 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -28,6 +28,9 @@ static void *seq_buf_alloc(unsigned long size)
void *buf;
gfp_t gfp = GFP_KERNEL;
+ if (unlikely(size > MAX_RW_COUNT))
+ return NULL;
+
/*
* For high order allocations, use __GFP_NORETRY to avoid oom-killing -
* it's better to fall back to vmalloc() than to kill things. For small