[PATCH] usb: phy: omap-otg: fix uninitialized pointer

2015-10-27 Thread Aaro Koskinen
otg_dev->extcon was referenced before otg_dev was initialized. Fix.

Cc: sta...@vger.kernel.org
Fixes: a2fd2423240f ("usb: phy: omap-otg: Replace deprecated API of extcon")
Signed-off-by: Aaro Koskinen 
---
 drivers/usb/phy/phy-omap-otg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c
index 1270906..c4bf2de 100644
--- a/drivers/usb/phy/phy-omap-otg.c
+++ b/drivers/usb/phy/phy-omap-otg.c
@@ -105,7 +105,6 @@ static int omap_otg_probe(struct platform_device *pdev)
extcon = extcon_get_extcon_dev(config->extcon);
if (!extcon)
return -EPROBE_DEFER;
-   otg_dev->extcon = extcon;
 
otg_dev = devm_kzalloc(>dev, sizeof(*otg_dev), GFP_KERNEL);
if (!otg_dev)
@@ -115,6 +114,7 @@ static int omap_otg_probe(struct platform_device *pdev)
if (IS_ERR(otg_dev->base))
return PTR_ERR(otg_dev->base);
 
+   otg_dev->extcon = extcon;
otg_dev->id_nb.notifier_call = omap_otg_id_notifier;
otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier;
 
-- 
2.4.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


Re: [PATCH] usb: phy: omap-otg: fix uninitialized pointer

2015-10-27 Thread Chanwoo Choi
Hi Aaro,

On 2015년 10월 28일 06:26, Aaro Koskinen wrote:
> otg_dev->extcon was referenced before otg_dev was initialized. Fix.
> 
> Cc: sta...@vger.kernel.org
> Fixes: a2fd2423240f ("usb: phy: omap-otg: Replace deprecated API of extcon")
> Signed-off-by: Aaro Koskinen 
> ---
>  drivers/usb/phy/phy-omap-otg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/phy/phy-omap-otg.c b/drivers/usb/phy/phy-omap-otg.c
> index 1270906..c4bf2de 100644
> --- a/drivers/usb/phy/phy-omap-otg.c
> +++ b/drivers/usb/phy/phy-omap-otg.c
> @@ -105,7 +105,6 @@ static int omap_otg_probe(struct platform_device *pdev)
>   extcon = extcon_get_extcon_dev(config->extcon);
>   if (!extcon)
>   return -EPROBE_DEFER;
> - otg_dev->extcon = extcon;
>  
>   otg_dev = devm_kzalloc(>dev, sizeof(*otg_dev), GFP_KERNEL);
>   if (!otg_dev)
> @@ -115,6 +114,7 @@ static int omap_otg_probe(struct platform_device *pdev)
>   if (IS_ERR(otg_dev->base))
>   return PTR_ERR(otg_dev->base);
>  
> + otg_dev->extcon = extcon;
>   otg_dev->id_nb.notifier_call = omap_otg_id_notifier;
>   otg_dev->vbus_nb.notifier_call = omap_otg_vbus_notifier;
>  
> 

Thanks for your fixes.

Reviewed-by: Chanwoo Choi 

Regards,
Chanwoo Choi
--
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