lkml.org 
[lkml]   [2014]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 1/2] tpm/tpm_ibmvtpm: Fail in ibmvtpm_get_data if driver_data is bad
> @@ -63,9 +63,9 @@ static int ibmvtpm_send_crq(struct vio_dev *vdev, u64 w1, u64 w2)
> static struct ibmvtpm_dev *ibmvtpm_get_data(const struct device *dev)
> {
> struct tpm_chip *chip = dev_get_drvdata(dev);
> - if (chip)
> - return (struct ibmvtpm_dev *)TPM_VPRIV(chip);
> - return NULL;
> +
> + BUG_ON(!chip);

With the recent patch from Vicky, it is possible to have a NULL value for
chip which will trigger a false positive for BUG_ON(!chip).

> + return (struct ibmvtpm_dev *)TPM_VPRIV(chip);
> }
>
> /**
>


\
 
 \ /
  Last update: 2014-12-02 21:01    [W:0.229 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site