From: Vardan Mikayelyan <mvar...@synopsys.com>

Use devm_kzalloc() and remove the unnecessary kfree().

Signed-off-by: Vardan Mikayelyan <mvar...@synopsys.com>
Signed-off-by: John Youn <johny...@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovma...@synopsys.com>
---
 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.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to