* + mm-vmpressure-pass-through-notification-support-fix.patch added to -mm tree
@ 2017-06-15 20:13 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2017-06-15 20:13 UTC (permalink / raw)
To: dan.carpenter, mhocko, minchan, rientjes, vinmenon, mm-commits
The patch titled
Subject: mm/vmpressure.c: free the same pointer we allocated
has been added to the -mm tree. Its filename is
mm-vmpressure-pass-through-notification-support-fix.patch
This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-vmpressure-pass-through-notification-support-fix.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-vmpressure-pass-through-notification-support-fix.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Dan Carpenter <dan.carpenter@oracle.com>
Subject: mm/vmpressure.c: free the same pointer we allocated
We keep incrementing "spec" as we parse the args so we end up calling
kfree() on a modified of spec. It probably works or this would have been
caught in testing, but it looks weird.
Link: http://lkml.kernel.org/r/20170613191820.GA20003@elgon.mountain
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Vinayak Menon <vinmenon@codeaurora.org>
Cc: Michal Hocko <mhocko@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/vmpressure.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff -puN mm/vmpressure.c~mm-vmpressure-pass-through-notification-support-fix mm/vmpressure.c
--- a/mm/vmpressure.c~mm-vmpressure-pass-through-notification-support-fix
+++ a/mm/vmpressure.c
@@ -386,11 +386,11 @@ int vmpressure_register_event(struct mem
struct vmpressure_event *ev;
enum vmpressure_modes mode = VMPRESSURE_NO_PASSTHROUGH;
enum vmpressure_levels level = -1;
- char *spec = NULL;
+ char *spec, *spec_orig;
char *token;
int ret = 0;
- spec = kzalloc(MAX_VMPRESSURE_ARGS_LEN + 1, GFP_KERNEL);
+ spec_orig = spec = kzalloc(MAX_VMPRESSURE_ARGS_LEN + 1, GFP_KERNEL);
if (!spec) {
ret = -ENOMEM;
goto out;
@@ -429,7 +429,7 @@ int vmpressure_register_event(struct mem
list_add(&ev->node, &vmpr->events);
mutex_unlock(&vmpr->events_lock);
out:
- kfree(spec);
+ kfree(spec_orig);
return ret;
}
_
Patches currently in -mm which might be from dan.carpenter@oracle.com are
mm-vmpressure-pass-through-notification-support-fix.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-06-15 20:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 20:13 + mm-vmpressure-pass-through-notification-support-fix.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.