diff options
-rw-r--r-- | drivers/char/tpm/tpm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index dae254d53723..d39b1f60ba23 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -1330,6 +1330,9 @@ EXPORT_SYMBOL_GPL(tpm_pm_resume); | |||
1330 | 1330 | ||
1331 | void tpm_dev_vendor_release(struct tpm_chip *chip) | 1331 | void tpm_dev_vendor_release(struct tpm_chip *chip) |
1332 | { | 1332 | { |
1333 | if (!chip) | ||
1334 | return; | ||
1335 | |||
1333 | if (chip->vendor.release) | 1336 | if (chip->vendor.release) |
1334 | chip->vendor.release(chip->dev); | 1337 | chip->vendor.release(chip->dev); |
1335 | 1338 | ||
@@ -1347,6 +1350,9 @@ void tpm_dev_release(struct device *dev) | |||
1347 | { | 1350 | { |
1348 | struct tpm_chip *chip = dev_get_drvdata(dev); | 1351 | struct tpm_chip *chip = dev_get_drvdata(dev); |
1349 | 1352 | ||
1353 | if (!chip) | ||
1354 | return; | ||
1355 | |||
1350 | tpm_dev_vendor_release(chip); | 1356 | tpm_dev_vendor_release(chip); |
1351 | 1357 | ||
1352 | chip->release(dev); | 1358 | chip->release(dev); |