Attention is currently required from: Arthur Heymans, Christian Walter, Felix Held, Krystian Hebel, Michał Żygowski, Sergii Dmytruk.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/76954?usp=email )
Change subject: security/tpm/: turn tis_{init,open} into tis_probe ......................................................................
Patch Set 1: Code-Review+2
(1 comment)
Patchset:
PS1: Have we root caused what led to this problem on the Crater Lake platform? Has that issue been fixed yet?
In general, I think for these kinds of "things that shouldn't happen" programming error mistakes, just returning NULL is not a good solution. It just hands off responsibility to deal with the problem to the calling code which is probably not any better to equipped to deal with it either. Either way it indicates a bug that has to be fixed, and using die() makes that bug more visible while the error code may get lost on its way up the stack.
I don't particularly care so much in this case because the function may already return NULL in other (more legitimate) cases anyway, so the callers already need to be prepared to deal with that... I'm okay merging it like this if you want to, but we shouldn't consider this as a "fix" to the original problem, that's still a bug that needs to be addressed.