From b10129de2ef40613bdaaa6993bda5360fbaa3224 Mon Sep 17 00:00:00 2001 From: Vardan Mikayelyan Date: Fri, 19 Jan 2018 14:45:12 +0400 Subject: [PATCH] usb: dwc2: pci: Replace kzalloc() with devm_kzalloc() Use devm_kzalloc() and remove the unnecessary kfree(). Acked-by: John Youn Signed-off-by: Vardan Mikayelyan Signed-off-by: John Youn Signed-off-by: Grigor Tovmasyan Signed-off-by: Felipe Balbi --- drivers/usb/dwc2/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c index 3ecc951a1aea..8c6a65188412 100644 --- a/drivers/usb/dwc2/pci.c +++ b/drivers/usb/dwc2/pci.c @@ -83,7 +83,6 @@ static void dwc2_pci_remove(struct pci_dev *pci) platform_device_unregister(glue->dwc2); usb_phy_generic_unregister(glue->phy); - kfree(glue); pci_set_drvdata(pci, NULL); } @@ -147,7 +146,7 @@ static int dwc2_pci_probe(struct pci_dev *pci, goto err; } - glue = kzalloc(sizeof(*glue), GFP_KERNEL); + glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL); if (!glue) return -ENOMEM; -- 2.45.2