struct ishtp_device *dev;
        int     i;
 
-       dev = kzalloc(sizeof(struct ishtp_device) + sizeof(struct ish_hw),
-               GFP_KERNEL);
+       dev = devm_kzalloc(&pdev->dev,
+                          sizeof(struct ishtp_device) + sizeof(struct ish_hw),
+                          GFP_KERNEL);
        if (!dev)
                return NULL;
 
        for (i = 0; i < IPC_TX_FIFO_SIZE; ++i) {
                struct wr_msg_ctl_info  *tx_buf;
 
-               tx_buf = kzalloc(sizeof(struct wr_msg_ctl_info), GFP_KERNEL);
+               tx_buf = devm_kzalloc(&pdev->dev,
+                                     sizeof(struct wr_msg_ctl_info),
+                                     GFP_KERNEL);
                if (!tx_buf) {
                        /*
                         * IPC buffers may be limited or not available
 
        free_irq(pdev->irq, dev);
 free_device:
        pci_iounmap(pdev, hw->mem_addr);
-       kfree(dev);
 release_regions:
        pci_release_regions(pdev);
 disable_device:
        pci_release_regions(pdev);
        pci_clear_master(pdev);
        pci_disable_device(pdev);
-       kfree(ishtp_dev);
 }
 
 static struct device __maybe_unused *ish_resume_device;