summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHon Ching \(Vicky\) Lo <honclo@linux.vnet.ibm.com>2015-10-07 20:11:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-19 14:22:38 -0800
commit2acba4b8b307985e93a2d86e619f8a16d39a247b (patch)
treebd87a9253169c3a41e9d3bbd0d5741a553e8d9f1
parentc0d57f2bd29e813cb12f84cc2dd0d7508134bc26 (diff)
downloadlinux-stable-2acba4b8b307985e93a2d86e619f8a16d39a247b.tar.gz
linux-stable-2acba4b8b307985e93a2d86e619f8a16d39a247b.tar.bz2
linux-stable-2acba4b8b307985e93a2d86e619f8a16d39a247b.zip
vTPM: fix memory allocation flag for rtce buffer at kernel boot
commit 60ecd86c4d985750efa0ea3d8610972b09951715 upstream. At ibm vtpm initialzation, tpm_ibmvtpm_probe() registers its interrupt handler, ibmvtpm_interrupt, which calls ibmvtpm_crq_process to allocate memory for rtce buffer. The current code uses 'GFP_KERNEL' as the type of kernel memory allocation, which resulted a warning at kernel/lockdep.c. This patch uses 'GFP_ATOMIC' instead so that the allocation is high-priority and does not sleep. Signed-off-by: Hon Ching(Vicky) Lo <honclo@linux.vnet.ibm.com> Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/char/tpm/tpm_ibmvtpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
index a6524c3efdf7..ce854bbd33ef 100644
--- a/drivers/char/tpm/tpm_ibmvtpm.c
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -529,7 +529,7 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq,
}
ibmvtpm->rtce_size = be16_to_cpu(crq->len);
ibmvtpm->rtce_buf = kmalloc(ibmvtpm->rtce_size,
- GFP_KERNEL);
+ GFP_ATOMIC);
if (!ibmvtpm->rtce_buf) {
dev_err(ibmvtpm->dev, "Failed to allocate memory for rtce buffer\n");
return;