Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ac33417ecf8c012df0e957cfa0628a6a4347c7d
Commit:     7ac33417ecf8c012df0e957cfa0628a6a4347c7d
Parent:     2ffbb8377c7a0713baf6644e285adc27a5654582
Author:     Cyrill Gorcunov <[EMAIL PROTECTED]>
AuthorDate: Thu Nov 15 21:47:06 2007 +0300
Committer:  Kumar Gala <[EMAIL PROTECTED]>
CommitDate: Mon Nov 19 22:03:00 2007 -0600

    [POWERPC] Fix potential NULL dereference
    
    This patch does fix potential NULL pointer dereference that could take
    place inside of strcmp() if of_get_property() call failed.
    
    Signed-off-by: Cyrill Gorcunov <[EMAIL PROTECTED]>
    Signed-off-by: Kumar Gala <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/83xx/usb.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/83xx/usb.c 
b/arch/powerpc/platforms/83xx/usb.c
index eafe760..b45160f 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -130,7 +130,7 @@ int mpc831x_usb_cfg(void)
        out_be32(immap + MPC83XX_SCCR_OFFS, temp);
 
        /* Configure pin mux for ULPI.  There is no pin mux for UTMI */
-       if (!strcmp(prop, "ulpi")) {
+       if (prop && !strcmp(prop, "ulpi")) {
                temp = in_be32(immap + MPC83XX_SICRL_OFFS);
                temp &= ~MPC831X_SICRL_USB_MASK;
                temp |= MPC831X_SICRL_USB_ULPI;
@@ -153,13 +153,13 @@ int mpc831x_usb_cfg(void)
        usb_regs = ioremap(res.start, res.end - res.start + 1);
 
        /* Using on-chip PHY */
-       if (!strcmp(prop, "utmi_wide") ||
-                       !strcmp(prop, "utmi")) {
+       if (prop && (!strcmp(prop, "utmi_wide") ||
+                    !strcmp(prop, "utmi"))) {
                /* Set UTMI_PHY_EN, REFSEL to 48MHZ */
                out_be32(usb_regs + FSL_USB2_CONTROL_OFFS,
                                CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ);
        /* Using external UPLI PHY */
-       } else if (!strcmp(prop, "ulpi")) {
+       } else if (prop && !strcmp(prop, "ulpi")) {
                /* Set PHY_CLK_SEL to ULPI */
                temp = CONTROL_PHY_CLK_SEL_ULPI;
 #ifdef CONFIG_USB_OTG
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to