Re: [PATCH] Infineon TPM: IO-port leakage fix, WTX-bugfix

From: Randy.Dunlap
Date: Wed Feb 15 2006 - 23:36:30 EST


On Wed, 15 Feb 2006 14:43:47 +0100 Marcel Selhorst wrote:

> Dear all,
>
> this patch fixes IO-port leakage from request_region in case of error during TPM
> initialization, adds more pnp-verification and fixes a WTX-bug.
>
> Best regards,
> Marcel Selhorst
>
> Signed-off-by: Marcel Selhorst <selhorst@xxxxxxxxxxxxx>
> ---
>
> --- linux-2.6.16-rc2/drivers/char/tpm/tpm_infineon.c.old 2006-02-08
> 11:45:09.000000000 +0100

Those 2 lines ^^^^^ should have been one line. Email client strikes again.

> +++ linux-2.6.16-rc2/drivers/char/tpm/tpm_infineon.c 2006-02-15 13:32:00.000000000 +0100
> @@ -471,14 +484,21 @@ static int __devinit tpm_inf_pnp_probe(s
>
> rc = tpm_register_hardware(&dev->dev, &tpm_inf);
> if (rc < 0) {
> - release_region(tpm_inf.base, TPM_INF_PORT_LEN);
> - return -ENODEV;
> + rc = -ENODEV;
> + goto err_release_region;
> }
> return 0;
> } else {
> - dev_info(&dev->dev, "No Infineon TPM found!\n");
> - return -ENODEV;
> + rc = -ENODEV;
> + goto err_release_region;
> }
> +
> +err_release_region:
> +release_region(tpm_inf.base, TPM_INF_PORT_LEN);
> +release_region(TPM_INF_ADDR, TPM_INF_ADDR_LEN);
> +
> +err_last:
> +return rc;
> }

The release_region() calls and return should be indented one tab stop.
(email client again??)

---
~Randy
-
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/