svn commit: r368194 - head/sys/dev/qat

Mark Johnston markj at FreeBSD.org
Mon Nov 30 20:53:45 UTC 2020


Author: markj
Date: Mon Nov 30 20:53:45 2020
New Revision: 368194
URL: https://svnweb.freebsd.org/changeset/base/368194

Log:
  qat: Initialize the crypto device ID to -1 instead of 0
  
  Otherwise qat_detach() may attempt to deregister an unrelated crypto
  driver if an error occurs in qat_attach() before crypto_get_driverid()
  is called, since 0 is a valid driver ID.
  
  MFC after:	3 days
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Modified:
  head/sys/dev/qat/qat.c

Modified: head/sys/dev/qat/qat.c
==============================================================================
--- head/sys/dev/qat/qat.c	Mon Nov 30 20:53:25 2020	(r368193)
+++ head/sys/dev/qat/qat.c	Mon Nov 30 20:53:45 2020	(r368194)
@@ -357,6 +357,7 @@ qat_attach(device_t dev)
 
 	sc->sc_dev = dev;
 	sc->sc_rev = pci_get_revid(dev);
+	sc->sc_crypto.qcy_cid = -1;
 
 	qatp = qat_lookup(dev);
 	memcpy(&sc->sc_hw, qatp->qatp_hw, sizeof(struct qat_hw));


More information about the svn-src-head mailing list