[PATCH v2] tpm: Fix null pointer dereference on chip register error path