public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] usb: musb: fix null pointer check in musb_platform_init()
@ 2009-01-07 11:14 Ajay Kumar Gupta
       [not found] ` <1231326860-22727-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Ajay Kumar Gupta @ 2009-01-07 11:14 UTC (permalink / raw)
  To: linux-usb; +Cc: linux-omap, david-b, felipe.balbi, Ajay Kumar Gupta

Fixes kernel panic when musb is selected for OMAP35x EVM but twl4030 is not
selected as in this case otg_get_transceiver() returns null.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 drivers/usb/musb/omap2430.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 3f99536..6ddc986 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -232,6 +232,8 @@ int __init musb_platform_init(struct musb *musb)
 #if defined(CONFIG_ARCH_OMAP2430)
 	omap_cfg_reg(AE5_2430_USB0HS_STP);
 #endif
+	if (!x)
+		return -ENODEV;
 
 	musb->xceiv = *x;
 	musb_platform_resume(musb);
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] usb: musb: fix null pointer check in musb_platform_init()
       [not found] ` <1231326860-22727-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
@ 2009-01-12 22:31   ` Felipe Balbi
  2009-01-13  6:47     ` Gupta, Ajay Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Felipe Balbi @ 2009-01-12 22:31 UTC (permalink / raw)
  To: Ajay Kumar Gupta
  Cc: linux-usb-u79uwXL29TY76Z2rM5mHXA,
	linux-omap-u79uwXL29TY76Z2rM5mHXA, david-b-yBeKhBN/0LDR7s880joybQ,
	felipe.balbi-xNZwKgViW5gAvxtiuMwx3w

On Wed, Jan 07, 2009 at 04:44:20PM +0530, Ajay Kumar Gupta wrote:
> Fixes kernel panic when musb is selected for OMAP35x EVM but twl4030 is not
> selected as in this case otg_get_transceiver() returns null.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta-l0cyMroinI0@public.gmane.org>

Ajay, can you update this patch so we dev_err() the absence of a
transceiver driver ???

Thanks, besides that, you can put my s-o-b or ack

> ---
>  drivers/usb/musb/omap2430.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> index 3f99536..6ddc986 100644
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -232,6 +232,8 @@ int __init musb_platform_init(struct musb *musb)
>  #if defined(CONFIG_ARCH_OMAP2430)
>  	omap_cfg_reg(AE5_2430_USB0HS_STP);
>  #endif
> +	if (!x)
> +		return -ENODEV;
>  
>  	musb->xceiv = *x;
>  	musb_platform_resume(musb);
> -- 
> 1.5.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 3/3] usb: musb: fix null pointer check in musb_platform_init()
  2009-01-12 22:31   ` Felipe Balbi
@ 2009-01-13  6:47     ` Gupta, Ajay Kumar
  2009-01-23 10:16       ` Felipe Balbi
  0 siblings, 1 reply; 4+ messages in thread
From: Gupta, Ajay Kumar @ 2009-01-13  6:47 UTC (permalink / raw)
  To: me@felipebalbi.com
  Cc: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org,
	david-b@pacbell.net, felipe.balbi@nokia.com

> -----Original Message-----
> From: Felipe Balbi [mailto:me@felipebalbi.com]
> Sent: Tuesday, January 13, 2009 4:02 AM
> To: Gupta, Ajay Kumar
> Cc: linux-usb@vger.kernel.org; linux-omap@vger.kernel.org; david-b@pacbell.net;
> felipe.balbi@nokia.com
> Subject: Re: [PATCH 3/3] usb: musb: fix null pointer check in musb_platform_init()
> 
> On Wed, Jan 07, 2009 at 04:44:20PM +0530, Ajay Kumar Gupta wrote:
> > Fixes kernel panic when musb is selected for OMAP35x EVM but twl4030 is not
> > selected as in this case otg_get_transceiver() returns null.
> >
> > Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> 
> Ajay, can you update this patch so we dev_err() the absence of a
> transceiver driver ???
> 
> Thanks, besides that, you can put my s-o-b or ack

Felipe, please check if the below one is fine.

-Ajay
> --
> balbi

========================== cut here =========================================
Fixes kernel panic when musb is selected for OMAP35x EVM but twl4030 is not
selected as in this case otg_get_transceiver() returns null.

Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
---
 drivers/usb/musb/omap2430.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
index 3f99536..93252c9 100644
--- a/drivers/usb/musb/omap2430.c
+++ b/drivers/usb/musb/omap2430.c
@@ -232,6 +232,10 @@ int __init musb_platform_init(struct musb *musb)
 #if defined(CONFIG_ARCH_OMAP2430)
 	omap_cfg_reg(AE5_2430_USB0HS_STP);
 #endif
+	if (!x) {
+		pr_err("omap: musb: null transceiver found\n");
+		return -ENODEV;
+	}
 
 	musb->xceiv = *x;
 	musb_platform_resume(musb);
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/3] usb: musb: fix null pointer check in musb_platform_init()
  2009-01-13  6:47     ` Gupta, Ajay Kumar
@ 2009-01-23 10:16       ` Felipe Balbi
  0 siblings, 0 replies; 4+ messages in thread
From: Felipe Balbi @ 2009-01-23 10:16 UTC (permalink / raw)
  To: ext Gupta, Ajay Kumar
  Cc: me@felipebalbi.com, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, david-b@pacbell.net,
	felipe.balbi@nokia.com

this one is also safe to apply

On Tue, Jan 13, 2009 at 12:17:39PM +0530, Ajay Kumar Gupta wrote:
> Fixes kernel panic when musb is selected for OMAP35x EVM but twl4030 is not
> selected as in this case otg_get_transceiver() returns null.
> 
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> Acked-by: Felipe Balbi <felipe.balbi@nokia.com>
> ---
>  drivers/usb/musb/omap2430.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
> index 3f99536..93252c9 100644
> --- a/drivers/usb/musb/omap2430.c
> +++ b/drivers/usb/musb/omap2430.c
> @@ -232,6 +232,10 @@ int __init musb_platform_init(struct musb *musb)
>  #if defined(CONFIG_ARCH_OMAP2430)
>  	omap_cfg_reg(AE5_2430_USB0HS_STP);
>  #endif
> +	if (!x) {
> +		pr_err("omap: musb: null transceiver found\n");
> +		return -ENODEV;
> +	}
>  
>  	musb->xceiv = *x;
>  	musb_platform_resume(musb);
> -- 
> 1.5.6

-- 
balbi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-23 10:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 11:14 [PATCH 3/3] usb: musb: fix null pointer check in musb_platform_init() Ajay Kumar Gupta
     [not found] ` <1231326860-22727-1-git-send-email-ajay.gupta-l0cyMroinI0@public.gmane.org>
2009-01-12 22:31   ` Felipe Balbi
2009-01-13  6:47     ` Gupta, Ajay Kumar
2009-01-23 10:16       ` Felipe Balbi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox