This avoids accidentially changing the structure definition, without adopting this size check.
Signed-off-by: Alexander Steffen <alexander.stef...@infineon.com> --- drivers/char/tpm/tpm-dev-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/tpm/tpm-dev-common.c b/drivers/char/tpm/tpm-dev-common.c index 610638a..192740e 100644 --- a/drivers/char/tpm/tpm-dev-common.c +++ b/drivers/char/tpm/tpm-dev-common.c @@ -99,7 +99,7 @@ ssize_t tpm_common_write(struct file *file, const char __user *buf, if (atomic_read(&priv->data_pending) != 0) return -EBUSY; - if (in_size > TPM_BUFSIZE) + if (in_size > sizeof(priv->data_buffer)) return -E2BIG; mutex_lock(&priv->buffer_mutex); -- 2.7.4 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ tpmdd-devel mailing list tpmdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tpmdd-devel