RE: [PATCH] driver/char/tpm: fix regression causesd by ppi
From: Wei, Gang
Date: Tue Oct 09 2012 - 22:09:58 EST
Kent Yoder wrote on 2012-10-10:
> On Tue, Oct 09, 2012 at 05:35:22PM +0800, gang.wei@xxxxxxxxx wrote:
>> @@ -1476,7 +1477,7 @@ struct tpm_chip *tpm_register_hardware(struct
> device *dev,
>> goto put_device;
>> }
>> - if (sys_add_ppi(&dev->kobj)) {
>> + if (tpm_add_ppi(&dev->kobj)) {
>> misc_deregister(&chip->vendor.miscdev);
>> goto put_device;
>> }
>>
> Hmm, tpm_add_ppi is just sysfs_create_group, which only ever returns
> 0. Looks like we can remove this error path, but PPI is unusable in the
> failure case.
sysfs_create_group will return 0 on success or return error code. So I don't
think we can remove this error path. The previous call to sysfs_create_group
also have similar error path.
>> +EXPORT_SYMBOL_GPL(tpm_add_ppi);
>> ...
>> +EXPORT_SYMBOL_GPL(tpm_remove_ppi);
>>
> Do we need to export these symbols? These might have been left around
> from when ppi was a standalone module.
We definitely need to export these symbols, since ppi was in tpm_bios.ko,
and these symbols are called from tpm.ko.
Jimmy
Attachment:
smime.p7s
Description: S/MIME cryptographic signature