···907907 struct ishtp_device *dev;908908 int i;909909910910- dev = kzalloc(sizeof(struct ishtp_device) + sizeof(struct ish_hw),911911- GFP_KERNEL);910910+ dev = devm_kzalloc(&pdev->dev,911911+ sizeof(struct ishtp_device) + sizeof(struct ish_hw),912912+ GFP_KERNEL);912913 if (!dev)913914 return NULL;914915···926925 for (i = 0; i < IPC_TX_FIFO_SIZE; ++i) {927926 struct wr_msg_ctl_info *tx_buf;928927929929- tx_buf = kzalloc(sizeof(struct wr_msg_ctl_info), GFP_KERNEL);928928+ tx_buf = devm_kzalloc(&pdev->dev,929929+ sizeof(struct wr_msg_ctl_info),930930+ GFP_KERNEL);930931 if (!tx_buf) {931932 /*932933 * IPC buffers may be limited or not available
+11-2
drivers/hid/intel-ish-hid/ipc/pci-ish.c
···9595 return 0;9696}97979898+static const struct pci_device_id ish_invalid_pci_ids[] = {9999+ /* Mehlow platform special pci ids */100100+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA309)},101101+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA30A)},102102+ {}103103+};104104+98105/**99106 * ish_probe() - PCI driver probe callback100107 * @pdev: pci device···116109 struct ishtp_device *dev;117110 struct ish_hw *hw;118111 int ret;112112+113113+ /* Check for invalid platforms for ISH support */114114+ if (pci_dev_present(ish_invalid_pci_ids))115115+ return -ENODEV;119116120117 /* enable pci dev */121118 ret = pci_enable_device(pdev);···183172 free_irq(pdev->irq, dev);184173free_device:185174 pci_iounmap(pdev, hw->mem_addr);186186- kfree(dev);187175release_regions:188176 pci_release_regions(pdev);189177disable_device:···212202 pci_release_regions(pdev);213203 pci_clear_master(pdev);214204 pci_disable_device(pdev);215215- kfree(ishtp_dev);216205}217206218207static struct device __maybe_unused *ish_resume_device;