Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752460AbbHaUXy (ORCPT ); Mon, 31 Aug 2015 16:23:54 -0400 Received: from www62.your-server.de ([213.133.104.62]:36497 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbbHaUXx (ORCPT ); Mon, 31 Aug 2015 16:23:53 -0400 From: Daniel Borkmann To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, Daniel Borkmann Subject: [PATCH -akpm] mm, slab: fix argument order in cache_from_obj's error message Date: Mon, 31 Aug 2015 22:23:50 +0200 Message-Id: X-Mailer: git-send-email 1.9.3 X-Authenticated-Sender: daniel@iogearbox.net Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1065 Lines: 33 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 --- mm/slab.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slab.h b/mm/slab.h index 8da63e4..819f27e 100644 --- a/mm/slab.h +++ b/mm/slab.h @@ -321,7 +321,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; } -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/