]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tpm: st33zp24: remove redundant null check on chip
authorColin Ian King <colin.king@canonical.com>
Fri, 6 Apr 2018 16:21:44 +0000 (17:21 +0100)
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Wed, 9 May 2018 11:45:46 +0000 (14:45 +0300)
Currently chip is being dereferenced by the call to dev_get_drvdata
before it is being null checked, however, chip can never be null, so
this check is misleading and redundant. Remove it.

Detected by CoverityScan, CID#1357806 ("Dereference before null check")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Jarkko Sakkinen <jarkkko.sakkinen@linux.intel.com>
Signed-off-by: Jarkko Sakkinen <jarkkko.sakkinen@linux.intel.com>
drivers/char/tpm/st33zp24/st33zp24.c

index f95b9c75175bcf27825b16891ca405886e51c379..abd675bec88c8435a6b1277b3fac6336d0339c21 100644 (file)
@@ -373,8 +373,6 @@ static int st33zp24_send(struct tpm_chip *chip, unsigned char *buf,
        int ret;
        u8 data;
 
-       if (!chip)
-               return -EBUSY;
        if (len < TPM_HEADER_SIZE)
                return -EBUSY;