mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
cxgbev(4): verify the vendor id before claiming a device
PR: 299002 Reviewed by: jhb MFC after: 1 week Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D60203
This commit is contained in:
1 parent
a2fbd98863
commit
5f275e5478
1 file changed
+20
-4
+20
-4
@@ -160,9 +160,13 @@ static struct cdevsw t4vf_cdevsw = {
|
||||
static int
|
||||
t4vf_probe(device_t dev)
|
||||
{
|
||||
uint16_t d;
|
||||
uint16_t d, v;
|
||||
size_t i;
|
||||
|
||||
v = pci_get_vendor(dev);
|
||||
if (v != PCI_VENDOR_ID_CHELSIO)
|
||||
return (ENXIO);
|
||||
|
||||
d = pci_get_device(dev);
|
||||
for (i = 0; i < nitems(t4vf_pciids); i++) {
|
||||
if (d == t4vf_pciids[i].device) {
|
||||
@@ -176,9 +180,13 @@ t4vf_probe(device_t dev)
|
||||
static int
|
||||
t5vf_probe(device_t dev)
|
||||
{
|
||||
uint16_t d;
|
||||
uint16_t d, v;
|
||||
size_t i;
|
||||
|
||||
v = pci_get_vendor(dev);
|
||||
if (v != PCI_VENDOR_ID_CHELSIO)
|
||||
return (ENXIO);
|
||||
|
||||
d = pci_get_device(dev);
|
||||
for (i = 0; i < nitems(t5vf_pciids); i++) {
|
||||
if (d == t5vf_pciids[i].device) {
|
||||
@@ -192,9 +200,13 @@ t5vf_probe(device_t dev)
|
||||
static int
|
||||
t6vf_probe(device_t dev)
|
||||
{
|
||||
uint16_t d;
|
||||
uint16_t d, v;
|
||||
size_t i;
|
||||
|
||||
v = pci_get_vendor(dev);
|
||||
if (v != PCI_VENDOR_ID_CHELSIO)
|
||||
return (ENXIO);
|
||||
|
||||
d = pci_get_device(dev);
|
||||
for (i = 0; i < nitems(t6vf_pciids); i++) {
|
||||
if (d == t6vf_pciids[i].device) {
|
||||
@@ -208,9 +220,13 @@ t6vf_probe(device_t dev)
|
||||
static int
|
||||
chvf_probe(device_t dev)
|
||||
{
|
||||
uint16_t d;
|
||||
uint16_t d, v;
|
||||
size_t i;
|
||||
|
||||
v = pci_get_vendor(dev);
|
||||
if (v != PCI_VENDOR_ID_CHELSIO)
|
||||
return (ENXIO);
|
||||
|
||||
d = pci_get_device(dev);
|
||||
for (i = 0; i < nitems(t7vf_pciids); i++) {
|
||||
if (d == t7vf_pciids[i].device) {
|
||||
|
||||
Reference in new issue
Block a user