From: Greg Kroah-Hartman Date: Thu, 16 Aug 2018 10:37:29 +0000 (+0200) Subject: 3.18-stable patches X-Git-Tag: v3.18.119~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=132e31b7f92b1312fb6518d26fe0720c3038ed9a;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: mm-slub-fix-format-mismatches-in-slab_err-callers.patch --- diff --git a/queue-3.18/mm-slub-fix-format-mismatches-in-slab_err-callers.patch b/queue-3.18/mm-slub-fix-format-mismatches-in-slab_err-callers.patch new file mode 100644 index 00000000000..4a2bf4cdd81 --- /dev/null +++ b/queue-3.18/mm-slub-fix-format-mismatches-in-slab_err-callers.patch @@ -0,0 +1,67 @@ +From f6edde9cbe0634e4391b6e421a609ca3f57f6c38 Mon Sep 17 00:00:00 2001 +From: Andrey Ryabinin +Date: Wed, 10 Dec 2014 15:42:22 -0800 +Subject: mm: slub: fix format mismatches in slab_err() callers + +From: Andrey Ryabinin + +commit f6edde9cbe0634e4391b6e421a609ca3f57f6c38 upstream. + +Adding __printf(3, 4) to slab_err exposed following: + + mm/slub.c: In function `check_slab': + mm/slub.c:852:4: warning: format `%u' expects argument of type `unsigned int', but argument 4 has type `const char *' [-Wformat=] + s->name, page->objects, maxobj); + ^ + mm/slub.c:852:4: warning: too many arguments for format [-Wformat-extra-args] + mm/slub.c:857:4: warning: format `%u' expects argument of type `unsigned int', but argument 4 has type `const char *' [-Wformat=] + s->name, page->inuse, page->objects); + ^ + mm/slub.c:857:4: warning: too many arguments for format [-Wformat-extra-args] + + mm/slub.c: In function `on_freelist': + mm/slub.c:905:4: warning: format `%d' expects argument of type `int', but argument 5 has type `long unsigned int' [-Wformat=] + "should be %d", page->objects, max_objects); + +Fix first two warnings by removing redundant s->name. +Fix the last by changing type of max_object from unsigned long to int. + +Signed-off-by: Andrey Ryabinin +Cc: Christoph Lameter +Cc: Pekka Enberg +Acked-by: David Rientjes +Cc: Joonsoo Kim +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/slub.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/mm/slub.c ++++ b/mm/slub.c +@@ -849,12 +849,12 @@ static int check_slab(struct kmem_cache + maxobj = order_objects(compound_order(page), s->size, s->reserved); + if (page->objects > maxobj) { + slab_err(s, page, "objects %u > max %u", +- s->name, page->objects, maxobj); ++ page->objects, maxobj); + return 0; + } + if (page->inuse > page->objects) { + slab_err(s, page, "inuse %u > max %u", +- s->name, page->inuse, page->objects); ++ page->inuse, page->objects); + return 0; + } + /* Slab_pad_check fixes things up after itself */ +@@ -871,7 +871,7 @@ static int on_freelist(struct kmem_cache + int nr = 0; + void *fp; + void *object = NULL; +- unsigned long max_objects; ++ int max_objects; + + fp = page->freelist; + while (fp && nr <= page->objects) { diff --git a/queue-3.18/series b/queue-3.18/series index db629cfad41..7f96c69cc6f 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -5,3 +5,4 @@ fix-__legitimize_mnt-mntput-race.patch arm-dts-imx6sx-fix-irq-for-pcie-bridge.patch kprobes-x86-fix-p-uses-in-error-messages.patch alsa-info-check-for-integer-overflow-in-snd_info_entry_write.patch +mm-slub-fix-format-mismatches-in-slab_err-callers.patch