Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

klist: Fix object alignment on 64-bit.

Commit c0e69a5bbc6f ("klist.c: bit 0 in pointer can't be used as flag")
intended to make sure that all klist objects were at least pointer size
aligned, but used the constant "4" which only works on 32-bit.

Use "sizeof(void *)" which is correct in all cases.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: stable <stable@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

David Miller and committed by
Linus Torvalds
795abaf1 091994cf

+1 -1
+1 -1
include/linux/klist.h
··· 22 22 struct list_head k_list; 23 23 void (*get)(struct klist_node *); 24 24 void (*put)(struct klist_node *); 25 - } __attribute__ ((aligned (4))); 25 + } __attribute__ ((aligned (sizeof(void *)))); 26 26 27 27 #define KLIST_INIT(_name, _get, _put) \ 28 28 { .k_lock = __SPIN_LOCK_UNLOCKED(_name.k_lock), \