Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-4.19/intel-ish' into for-linus

Device-specific fixes for hid-intel-ish

+17 -5
+6 -3
drivers/hid/intel-ish-hid/ipc/ipc.c
··· 907 907 struct ishtp_device *dev; 908 908 int i; 909 909 910 - dev = kzalloc(sizeof(struct ishtp_device) + sizeof(struct ish_hw), 911 - GFP_KERNEL); 910 + dev = devm_kzalloc(&pdev->dev, 911 + sizeof(struct ishtp_device) + sizeof(struct ish_hw), 912 + GFP_KERNEL); 912 913 if (!dev) 913 914 return NULL; 914 915 ··· 926 925 for (i = 0; i < IPC_TX_FIFO_SIZE; ++i) { 927 926 struct wr_msg_ctl_info *tx_buf; 928 927 929 - tx_buf = kzalloc(sizeof(struct wr_msg_ctl_info), GFP_KERNEL); 928 + tx_buf = devm_kzalloc(&pdev->dev, 929 + sizeof(struct wr_msg_ctl_info), 930 + GFP_KERNEL); 930 931 if (!tx_buf) { 931 932 /* 932 933 * IPC buffers may be limited or not available
+11 -2
drivers/hid/intel-ish-hid/ipc/pci-ish.c
··· 95 95 return 0; 96 96 } 97 97 98 + static const struct pci_device_id ish_invalid_pci_ids[] = { 99 + /* Mehlow platform special pci ids */ 100 + {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA309)}, 101 + {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xA30A)}, 102 + {} 103 + }; 104 + 98 105 /** 99 106 * ish_probe() - PCI driver probe callback 100 107 * @pdev: pci device ··· 116 109 struct ishtp_device *dev; 117 110 struct ish_hw *hw; 118 111 int ret; 112 + 113 + /* Check for invalid platforms for ISH support */ 114 + if (pci_dev_present(ish_invalid_pci_ids)) 115 + return -ENODEV; 119 116 120 117 /* enable pci dev */ 121 118 ret = pci_enable_device(pdev); ··· 183 172 free_irq(pdev->irq, dev); 184 173 free_device: 185 174 pci_iounmap(pdev, hw->mem_addr); 186 - kfree(dev); 187 175 release_regions: 188 176 pci_release_regions(pdev); 189 177 disable_device: ··· 212 202 pci_release_regions(pdev); 213 203 pci_clear_master(pdev); 214 204 pci_disable_device(pdev); 215 - kfree(ishtp_dev); 216 205 } 217 206 218 207 static struct device __maybe_unused *ish_resume_device;