[PATCH 01/19] drivers/usb/musb: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen --- drivers/usb/musb/am35x.c|1 + drivers/usb/musb/blackfin.c |1 + drivers/usb/musb/da8xx.c|1 + drivers/usb/musb/davinci.c |1 + drivers/usb/musb/omap2430.c |1 + drivers/usb/musb/tusb6010.c |1 + drivers/usb/musb/ux500.c|1 + 7 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/am35x.c b/drivers/usb/musb/am35x.c index 2231850..1efe7c6 100644 --- a/drivers/usb/musb/am35x.c +++ b/drivers/usb/musb/am35x.c @@ -631,6 +631,7 @@ static struct platform_driver am35x_driver = { .remove = am35x_remove, .driver = { .name = "musb-am35x", + .owner = THIS_MODULE, .pm = DEV_PM_OPS, }, }; diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 5e63b16..483f388 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -563,6 +563,7 @@ static struct platform_driver bfin_driver = { .remove = __exit_p(bfin_remove), .driver = { .name = "musb-blackfin", + .owner = THIS_MODULE, .pm = DEV_PM_OPS, }, }; diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c index b903b74..d38f41c 100644 --- a/drivers/usb/musb/da8xx.c +++ b/drivers/usb/musb/da8xx.c @@ -575,6 +575,7 @@ static struct platform_driver da8xx_driver = { .remove = da8xx_remove, .driver = { .name = "musb-da8xx", + .owner = THIS_MODULE, }, }; diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index bea6cc3..acac555 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c @@ -607,6 +607,7 @@ static struct platform_driver davinci_driver = { .remove = davinci_remove, .driver = { .name = "musb-davinci", + .owner = THIS_MODULE, }, }; diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 3551f1a..2538fc7 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -668,6 +668,7 @@ static struct platform_driver omap2430_driver = { .remove = omap2430_remove, .driver = { .name = "musb-omap2430", + .owner = THIS_MODULE, .pm = DEV_PM_OPS, .of_match_table = of_match_ptr(omap2430_id_table), }, diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 7369ba3..96696dc 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -1231,6 +1231,7 @@ static struct platform_driver tusb_driver = { .remove = tusb_remove, .driver = { .name = "musb-tusb", + .owner = THIS_MODULE, }, }; diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c index 2c80004..aaae79e 100644 --- a/drivers/usb/musb/ux500.c +++ b/drivers/usb/musb/ux500.c @@ -325,6 +325,7 @@ static struct platform_driver ux500_driver = { .remove = ux500_remove, .driver = { .name = "musb-ux500", + .owner = THIS_MODULE, .pm = DEV_PM_OPS, }, }; -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/19] drivers/usb/dwc3: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen --- drivers/usb/dwc3/core.c|1 + drivers/usb/dwc3/dwc3-exynos.c |1 + drivers/usb/dwc3/dwc3-omap.c |1 + 3 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index c35d49d..570c2df 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -766,6 +766,7 @@ static struct platform_driver dwc3_driver = { .remove = dwc3_remove, .driver = { .name = "dwc3", + .owner = THIS_MODULE, .of_match_table = of_match_ptr(of_dwc3_match), .pm = DWC3_PM_OPS, }, diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c index a8afe6e..831aa81 100644 --- a/drivers/usb/dwc3/dwc3-exynos.c +++ b/drivers/usb/dwc3/dwc3-exynos.c @@ -219,6 +219,7 @@ static struct platform_driver dwc3_exynos_driver = { .remove = dwc3_exynos_remove, .driver = { .name = "exynos-dwc3", + .owner = THIS_MODULE, .of_match_table = of_match_ptr(exynos_dwc3_match), .pm = DEV_PM_OPS, }, diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 34638b9..3aaf87f 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c @@ -468,6 +468,7 @@ static struct platform_driver dwc3_omap_driver = { .remove = dwc3_omap_remove, .driver = { .name = "omap-dwc3", + .owner = THIS_MODULE, .of_match_table = of_dwc3_match, .pm = DEV_PM_OPS, }, -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 02/19] drivers/usb/host: add missing platform_driver owner
set the owner of platform_driver, to ensure that the caller of driver holds a module refernece Signed-off-by: Libo Chen --- drivers/usb/host/ehci-atmel.c |1 + drivers/usb/host/ehci-msm.c |1 + drivers/usb/host/ehci-mv.c |1 + drivers/usb/host/ehci-mxc.c |1 + drivers/usb/host/ehci-omap.c|1 + drivers/usb/host/ehci-spear.c |1 + drivers/usb/host/isp1760-if.c |1 + drivers/usb/host/oxu210hp-hcd.c |1 + drivers/usb/host/xhci-plat.c|1 + 9 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ehci-atmel.c b/drivers/usb/host/ehci-atmel.c index 6642009..4fbb59b 100644 --- a/drivers/usb/host/ehci-atmel.c +++ b/drivers/usb/host/ehci-atmel.c @@ -182,6 +182,7 @@ static struct platform_driver ehci_atmel_driver = { .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "atmel-ehci", + .owner = THIS_MODULE, .of_match_table = of_match_ptr(atmel_ehci_dt_ids), }, }; diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index 0f717dc..03e94d7 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c @@ -191,6 +191,7 @@ static struct platform_driver ehci_msm_driver = { .remove = ehci_msm_remove, .driver = { .name = "msm_hsusb_host", + .owner = THIS_MODULE, .pm = &ehci_msm_dev_pm_ops, }, }; diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 4020629..ba12653 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -335,6 +335,7 @@ static struct platform_driver ehci_mv_driver = { .shutdown = mv_ehci_shutdown, .driver = { .name = "mv-ehci", + .owner = THIS_MODULE, .bus = &platform_bus_type, }, .id_table = ehci_id_table, diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index c369767..e9c9651 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c @@ -214,6 +214,7 @@ static struct platform_driver ehci_mxc_driver = { .shutdown = ehci_mxc_drv_shutdown, .driver = { .name = "mxc-ehci", + .owner = THIS_MODULE, }, }; diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c index 3d1491b..f630e62 100644 --- a/drivers/usb/host/ehci-omap.c +++ b/drivers/usb/host/ehci-omap.c @@ -294,6 +294,7 @@ static struct platform_driver ehci_hcd_omap_driver = { /*.resume = ehci_hcd_omap_resume, */ .driver = { .name = hcd_name, + .owner = THIS_MODULE, .of_match_table = of_match_ptr(omap_ehci_dt_ids), } }; diff --git a/drivers/usb/host/ehci-spear.c b/drivers/usb/host/ehci-spear.c index 61ecfb3..2df73be 100644 --- a/drivers/usb/host/ehci-spear.c +++ b/drivers/usb/host/ehci-spear.c @@ -172,6 +172,7 @@ static struct platform_driver spear_ehci_hcd_driver = { .shutdown = usb_hcd_platform_shutdown, .driver = { .name = "spear-ehci", + .owner = THIS_MODULE, .bus = &platform_bus_type, .pm = &ehci_spear_pm_ops, .of_match_table = of_match_ptr(spear_ehci_id_table), diff --git a/drivers/usb/host/isp1760-if.c b/drivers/usb/host/isp1760-if.c index bbb791b..9c572da 100644 --- a/drivers/usb/host/isp1760-if.c +++ b/drivers/usb/host/isp1760-if.c @@ -435,6 +435,7 @@ static struct platform_driver isp1760_plat_driver = { .remove = isp1760_plat_remove, .driver = { .name = "isp1760", + .owner = THIS_MODULE, }, }; diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index 4f0f033..c5e1d1f 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c @@ -3947,6 +3947,7 @@ static struct platform_driver oxu_driver = { .resume = oxu_drv_resume, .driver = { .name = "oxu210hp-hcd", + .owner = THIS_MODULE, .bus = &platform_bus_type } }; diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c index df90fe5..34a6067 100644 --- a/drivers/usb/host/xhci-plat.c +++ b/drivers/usb/host/xhci-plat.c @@ -190,6 +190,7 @@ static struct platform_driver usb_xhci_driver = { .remove = xhci_plat_remove, .driver = { .name = "xhci-hcd", + .owner = THIS_MODULE, }, }; MODULE_ALIAS("platform:xhci-hcd"); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2] usb: omap2430: fix memleak in err case
when omap_get_control_dev faild, we should release related platform_device * Changelog from v1: * fix spell: s/fail/fails/, s/relational/related/ , thank Sergei Signed-off-by: Libo Chen --- drivers/usb/musb/omap2430.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index 3551f1a..b626f19 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -549,7 +549,8 @@ static int omap2430_probe(struct platform_device *pdev) glue->control_otghs = omap_get_control_dev(); if (IS_ERR(glue->control_otghs)) { dev_vdbg(&pdev->dev, "Failed to get control device\n"); - return -ENODEV; + ret = -ENODEV; + goto err2; } } else { glue->control_otghs = ERR_PTR(-ENODEV); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] usb: omap2430: fix memleak in err case
ping... On 2013/5/22 11:30, Libo Chen wrote: > > when omap_get_control_dev faild, we should release related platform_device > > * Changelog from v1: > * fix spell: s/fail/fails/, s/relational/related/ , thank Sergei > > > Signed-off-by: Libo Chen > --- > drivers/usb/musb/omap2430.c |3 ++- > 1 files changed, 2 insertions(+), 1 deletions(-) > > diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c > index 3551f1a..b626f19 100644 > --- a/drivers/usb/musb/omap2430.c > +++ b/drivers/usb/musb/omap2430.c > @@ -549,7 +549,8 @@ static int omap2430_probe(struct platform_device *pdev) > glue->control_otghs = omap_get_control_dev(); > if (IS_ERR(glue->control_otghs)) { > dev_vdbg(&pdev->dev, "Failed to get control device\n"); > - return -ENODEV; > + ret = -ENODEV; > + goto err2; > } > } else { > glue->control_otghs = ERR_PTR(-ENODEV); > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] usb: omap2430: fix memleak in err case
On 2013/5/28 23:34, Andy Shevchenko wrote: > No go. > > Check the 4b7e450fb5cefb5865c77999a675330206ab3b8a > And update you tree, please. > > -- > With Best Regards, > Andy Shevchenko > > It had been changed :( Thanks, Libo -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] usb: omap2430: fix memleak in err case
On 2013/5/29 1:40, Sergei Shtylyov wrote: > Hello. > > On 22-05-2013 7:30, Libo Chen wrote: > >> when omap_get_control_dev faild, we should release related platform_device > >> * Changelog from v1: >> * fix spell: s/fail/fails/, s/relational/related/ , thank Sergei >> > >It seems you've actually replaced "fail" with "faild", not "fails". sorry for my weak spell. thanks again, Libo > >> Signed-off-by: Libo Chen >> --- >> drivers/usb/musb/omap2430.c |3 ++- >> 1 files changed, 2 insertions(+), 1 deletions(-) > > WBR, Sergei > > > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html