mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 15:41:52 +02:00
powerpc/mm/hash: Check for non-kernel address in get_kernel_vsid()
get_kernel_vsid() has a very stern comment saying that it's only valid for kernel addresses, but there's nothing in the code to enforce that. Rather than hoping our callers are well behaved, add a check and return a VSID of 0 (invalid). Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
941711a3a0
commit
85beb1c486
|
|
@ -682,6 +682,9 @@ static inline unsigned long get_kernel_vsid(unsigned long ea, int ssize)
|
|||
{
|
||||
unsigned long context;
|
||||
|
||||
if (!is_kernel_addr(ea))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* For kernel space, we use context ids 1-4 to map the address space as
|
||||
* below:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user