Re: [PATCH] tpm: sysfs function buffer size fix

From: Ingo Oeser
Date: Tue Apr 11 2006 - 16:47:12 EST


Hi Kylene,

On Tuesday, 11. April 2006 22:15, Kylene Jo Hall wrote:
> --- linux-2.6.17-rc1-mm2/drivers/char/tpm/tpm.c 2006-04-11 14:56:13.311776750 -0500
> +++ linux-2.6.17-rc1/drivers/char/tpm/tpm.c 2006-04-11 15:03:29.427032250 -0500
> @@ -490,7 +490,7 @@ static ssize_t transmit_cmd(struct tpm_c
>
> void tpm_gen_interrupt(struct tpm_chip *chip)
> {
> - u8 data[30];
> + u8 data[max(ARRAY_SIZE(tpm_cap), 30)];
> ssize_t rc;
>
> memcpy(data, tpm_cap, sizeof(tpm_cap));
> @@ -504,7 +504,7 @@ EXPORT_SYMBOL_GPL(tpm_gen_interrupt);
>
> void tpm_get_timeouts(struct tpm_chip *chip)
> {
> - u8 data[30];
> + u8 data[max(ARRAY_SIZE(TPM_CAP), 30)];
> ssize_t rc;
> u32 timeout;
>

Once in ALL CAPS and once in lower case?
Sure about these?

Regards

Ingo Oeser
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/