Message ID | 1479429004-7962-2-git-send-email-stefanb@linux.vnet.ibm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 11/18/2016 06:00 AM, Stefan Berger wrote: > tpm_bios_log_setup() may return -ENODEV in case no log was > found. In this case we do not need to fail the device. > > Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> > --- > drivers/char/tpm/tpm-chip.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c > index 3f27753..2d6530b 100644 > --- a/drivers/char/tpm/tpm-chip.c > +++ b/drivers/char/tpm/tpm-chip.c > @@ -346,7 +346,7 @@ int tpm_chip_register(struct tpm_chip *chip) > tpm_sysfs_add_device(chip); > > rc = tpm_bios_log_setup(chip); > - if (rc == -ENODEV) > + if (rc != -ENODEV) > return rc; This will return even for (rc == 0). Thanks & Regards, - Nayna > > tpm_add_ppi(chip); > ------------------------------------------------------------------------------
On Thu, Nov 17, 2016 at 07:30:04PM -0500, Stefan Berger wrote: > tpm_bios_log_setup() may return -ENODEV in case no log was > found. In this case we do not need to fail the device. > > Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> > --- > drivers/char/tpm/tpm-chip.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c > index 3f27753..2d6530b 100644 > --- a/drivers/char/tpm/tpm-chip.c > +++ b/drivers/char/tpm/tpm-chip.c > @@ -346,7 +346,7 @@ int tpm_chip_register(struct tpm_chip *chip) > tpm_sysfs_add_device(chip); > > rc = tpm_bios_log_setup(chip); > - if (rc == -ENODEV) > + if (rc != -ENODEV) > return rc; > > tpm_add_ppi(chip); > -- > 2.4.3 CC to linux-security-module LGTM Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> /Jarkko ------------------------------------------------------------------------------
diff --git a/drivers/char/tpm/tpm-chip.c b/drivers/char/tpm/tpm-chip.c index 3f27753..2d6530b 100644 --- a/drivers/char/tpm/tpm-chip.c +++ b/drivers/char/tpm/tpm-chip.c @@ -346,7 +346,7 @@ int tpm_chip_register(struct tpm_chip *chip) tpm_sysfs_add_device(chip); rc = tpm_bios_log_setup(chip); - if (rc == -ENODEV) + if (rc != -ENODEV) return rc; tpm_add_ppi(chip);
tpm_bios_log_setup() may return -ENODEV in case no log was found. In this case we do not need to fail the device. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> --- drivers/char/tpm/tpm-chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)