summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorWojciech Ziemba <wojciech.ziemba@intel.com>2022-04-07 17:54:47 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2022-04-15 16:34:26 +0800
commit4b61d2bd346de12bb62668ae0dc2f332643067a3 (patch)
tree02583a80783015f8b81156dc72e57cdef22bf438 /drivers
parent569b462e6604fab6ec4dc6649d06ac62564567ce (diff)
downloadlinux-4b61d2bd346de12bb62668ae0dc2f332643067a3.tar.bz2
crypto: qat - add check for invalid PFVF protocol version 0
PFVF protocol version 0 is not a valid version, but PF drivers currently would report any such version from VFs as compatible. This patch adds an extra check for the invalid PFVF protocol version 0. Signed-off-by: Wojciech Ziemba <wojciech.ziemba@intel.com> Signed-off-by: Marco Chiappero <marco.chiappero@intel.com> Reviewed-by: Marco Chiappero <marco.chiappero@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c b/drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c
index 588352de1ef0..c059b98836aa 100644
--- a/drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c
+++ b/drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c
@@ -242,7 +242,9 @@ static int adf_handle_vf2pf_msg(struct adf_accel_dev *accel_dev, u8 vf_nr,
"VersionRequest received from VF%d (vers %d) to PF (vers %d)\n",
vf_nr, vf_compat_ver, ADF_PFVF_COMPAT_THIS_VERSION);
- if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION)
+ if (vf_compat_ver == 0)
+ compat = ADF_PF2VF_VF_INCOMPATIBLE;
+ else if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION)
compat = ADF_PF2VF_VF_COMPATIBLE;
else
compat = ADF_PF2VF_VF_COMPAT_UNKNOWN;