]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Do not assign thread.tidr if already assigned
authorVaibhav Jain <vaibhav@linux.vnet.ibm.com>
Fri, 24 Nov 2017 08:33:38 +0000 (14:03 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 29 Nov 2017 08:56:18 +0000 (19:56 +1100)
commit62e153c2931d463a72734aa100eac07fc9b49644
tree52eab6d31594903d88d7dd68f547d16bf873106c
parent2b27e9f87e3b660daded59c48edba9a3b8859208
powerpc: Do not assign thread.tidr if already assigned

If set_thread_tidr() is called twice for same task_struct then it will
allocate a new tidr value to it leaving the previous value still
dangling in the vas_thread_ida table.

To fix this the patch changes set_thread_tidr() to check if a tidr
value is already assigned to the task_struct and if yes then returns
zero.

Fixes: e232541bd90d("powerpc: Add support for setting SPRN_TIDR")
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
[mpe: Modify to return 0 in the success case, not the TID value]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/process.c