Skip to content

Commit 0a0a52a

Browse files
debox1jwrdegoede
authored andcommitted
platform/x86/intel/vsec: remove platform_info from vsec device structure
In preparation for exporting an API to register Intel Vendor Specific Extended Capabilities (VSEC) from other drivers, remove the pointer to platform_info from intel_vsec_device. This prevents a potential page fault when auxiliary drivers probe and attempt to dereference this pointer to access the needed quirks field. Instead, just add the quirks to intel_vsec_device. Signed-off-by: David E. Box <david.e.box@linux.intel.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20231129222132.2331261-5-david.e.box@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent dbc01b0 commit 0a0a52a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/platform/x86/intel/pmt/class.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bool intel_pmt_is_early_client_hw(struct device *dev)
3131
* differences from the server platforms (which use the Out Of Band
3232
* Management Services Module OOBMSM).
3333
*/
34-
return !!(ivdev->info->quirks & VSEC_QUIRK_EARLY_HW);
34+
return !!(ivdev->quirks & VSEC_QUIRK_EARLY_HW);
3535
}
3636
EXPORT_SYMBOL_NS_GPL(intel_pmt_is_early_client_hw, INTEL_PMT);
3737

drivers/platform/x86/intel/vsec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static int intel_vsec_add_dev(struct pci_dev *pdev, struct intel_vsec_header *he
194194
intel_vsec_dev->pcidev = pdev;
195195
intel_vsec_dev->resource = res;
196196
intel_vsec_dev->num_resources = header->num_entries;
197-
intel_vsec_dev->info = info;
197+
intel_vsec_dev->quirks = info->quirks;
198198

199199
if (header->id == VSEC_ID_SDSI)
200200
intel_vsec_dev->ida = &intel_vsec_sdsi_ida;

drivers/platform/x86/intel/vsec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ struct intel_vsec_device {
7979
struct pci_dev *pcidev;
8080
struct resource *resource;
8181
struct ida *ida;
82-
struct intel_vsec_platform_info *info;
8382
int num_resources;
8483
int id; /* xa */
8584
void *priv_data;
8685
size_t priv_data_size;
86+
unsigned long quirks;
8787
};
8888

8989
int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,

0 commit comments

Comments
 (0)