瀏覽代碼

platform/x86: intel_scu_ipc: Platform data is mandatory

Fail ->probe() if there is no platform data supplied.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Andy Shevchenko 8 年之前
父節點
當前提交
ac207ded45
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/platform/x86/intel_scu_ipc.c

+ 2 - 0
drivers/platform/x86/intel_scu_ipc.c

@@ -579,6 +579,8 @@ static int ipc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 		return -EBUSY;
 		return -EBUSY;
 
 
 	pdata = (struct intel_scu_ipc_pdata_t *)id->driver_data;
 	pdata = (struct intel_scu_ipc_pdata_t *)id->driver_data;
+	if (!pdata)
+		return -ENODEV;
 
 
 	scu->dev = &pdev->dev;
 	scu->dev = &pdev->dev;
 	scu->irq_mode = pdata->irq_mode;
 	scu->irq_mode = pdata->irq_mode;