Skip to content

Commit

Permalink
mm/slab.h: fix argument order in cache_from_obj's error message
Browse files Browse the repository at this point in the history
While debugging a networking issue, I hit a condition that triggered an
object to be freed into the wrong kmem cache, and thus triggered the
warning in cache_from_obj().

The arguments in the error message are in wrong order: the location
of the object's kmem cache is in cachep, not s.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Daniel Borkmann authored and Linus Torvalds committed Sep 4, 2015
1 parent 45eb00c commit 2d16e0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/slab.h
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ static inline struct kmem_cache *cache_from_obj(struct kmem_cache *s, void *x)
return cachep;

pr_err("%s: Wrong slab cache. %s but object is from %s\n",
__func__, cachep->name, s->name);
__func__, s->name, cachep->name);
WARN_ON_ONCE(1);
return s;
}
Expand Down

0 comments on commit 2d16e0f

Please sign in to comment.