linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] ARM: shmobile: marzen: Use error values in usb_power_*
Date: Wed, 22 May 2013 19:50:21 +0000	[thread overview]
Message-ID: <519D217D.2060405@cogentembedded.com> (raw)
In-Reply-To: <1369205290-6272-2-git-send-email-horms+renesas@verge.net.au>

Hello.

On 05/22/2013 10:48 AM, Simon Horman wrote:

> This patch updates the marzen board code as if USB PHY isn't enabled
> they phy will have a value set by ERR_PTR() rather than be NULL.
>
> Without this patch a NULL pointer dereference  and kernel panic
> occurs on initialisation of USB on marzen.
>
> This resolves a regression introduced in 3.10-rc1 by
> b7fa5c2aec5be083eb2719b405089703608e9bc6
> ("usb: phy: return -ENXIO when PHY layer isn't enabled").
>
> Tested-by: Nguyen Hong Ky <nh-ky@jinso.co.jp>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>   arch/arm/mach-shmobile/board-marzen.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c
> index 9105285..b9594e9 100644
> --- a/arch/arm/mach-shmobile/board-marzen.c
> +++ b/arch/arm/mach-shmobile/board-marzen.c
> @@ -212,8 +212,8 @@ static struct platform_device *marzen_devices[] __initdata = {
>   static struct usb_phy *phy;
>   static int usb_power_on(struct platform_device *pdev)
>   {
> -	if (!phy)
> -		return -EIO;
> +	if (IS_ERR(phy))

    And even before the mentioned commit the right check should have 
been IS_ERR_OR_NULL().
Thanks for finding/fixing this. Too bad I'll have to respin my USB 
patches now... :-)

WBR, Sergei


  reply	other threads:[~2013-05-22 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22  6:48 [GIT PULL] Renesas ARM SoC based marzen board fix for v3.10 Simon Horman
2013-05-22  6:48 ` [PATCH] ARM: shmobile: marzen: Use error values in usb_power_* Simon Horman
2013-05-22 19:50   ` Sergei Shtylyov [this message]
2013-05-25  0:59     ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2013-05-16  4:48 Simon Horman
2013-05-21  7:51 ` Nguyen Hong Ky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519D217D.2060405@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).