platform/x86: intel_scu_ipc: Platform data is mandatory
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 5 Apr 2017 16:05:24 +0000 (19:05 +0300)
committerDarren Hart (VMware) <dvhart@infradead.org>
Thu, 13 Apr 2017 17:16:03 +0000 (10:16 -0700)
Fail ->probe() if there is no platform data supplied.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel_scu_ipc.c

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