|
@@ -73,6 +73,10 @@ static int pci_vpd_read_dword ( struct pci_vpd *vpd, int address,
|
73
|
73
|
unsigned int retries;
|
74
|
74
|
uint16_t flag;
|
75
|
75
|
|
|
76
|
+ /* Fail if no VPD present */
|
|
77
|
+ if ( ! cap )
|
|
78
|
+ return -ENOTTY;
|
|
79
|
+
|
76
|
80
|
/* Return cached value, if present */
|
77
|
81
|
if ( pci_vpd_cache_is_valid ( vpd ) &&
|
78
|
82
|
( vpd->cache.address == address ) ) {
|
|
@@ -127,6 +131,10 @@ static int pci_vpd_write_dword ( struct pci_vpd *vpd, int address,
|
127
|
131
|
unsigned int retries;
|
128
|
132
|
uint16_t flag;
|
129
|
133
|
|
|
134
|
+ /* Fail if no VPD present */
|
|
135
|
+ if ( ! cap )
|
|
136
|
+ return -ENOTTY;
|
|
137
|
+
|
130
|
138
|
/* Invalidate cache */
|
131
|
139
|
pci_vpd_invalidate_cache ( vpd );
|
132
|
140
|
|