]> git.hungrycats.org Git - linux/commitdiff
kasan: free allocated shadow memory on MEM_CANCEL_ONLINE
authorDavid Hildenbrand <david@redhat.com>
Fri, 25 May 2018 21:48:08 +0000 (14:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 06:17:18 +0000 (08:17 +0200)
commit ed1596f9ab958dd156a66c9ff1029d3761c1786a upstream.

We have to free memory again when we cancel onlining, otherwise a later
onlining attempt will fail.

Link: http://lkml.kernel.org/r/20180522100756.18478-2-david@redhat.com
Fixes: fa69b5989bb0 ("mm/kasan: add support for memory hotplug")
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/kasan/kasan.c

index 2eb23bd15e5e8dc51c5d627d86e5664cd9279105..70741bec4bf2f8ad925f57641d512552c924d471 100644 (file)
@@ -865,6 +865,7 @@ static int __meminit kasan_mem_notifier(struct notifier_block *nb,
                kmemleak_ignore(ret);
                return NOTIFY_OK;
        }
+       case MEM_CANCEL_ONLINE:
        case MEM_OFFLINE: {
                struct vm_struct *vm;