aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2007-11-15 13:47:06 -0500
committerKumar Gala <galak@kernel.crashing.org>2007-11-19 23:03:00 -0500
commit7ac33417ecf8c012df0e957cfa0628a6a4347c7d (patch)
tree027c1104e206c2736c9f88dba41292222333463f /arch/powerpc/platforms
parent2ffbb8377c7a0713baf6644e285adc27a5654582 (diff)
[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 <gorcunov@gmail.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/83xx/usb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
index eafe7605cdac..b45160f8d084 100644
--- a/arch/powerpc/platforms/83xx/usb.c
+++ b/arch/powerpc/platforms/83xx/usb.c
@@ -130,7 +130,7 @@ int mpc831x_usb_cfg(void)
130 out_be32(immap + MPC83XX_SCCR_OFFS, temp); 130 out_be32(immap + MPC83XX_SCCR_OFFS, temp);
131 131
132 /* Configure pin mux for ULPI. There is no pin mux for UTMI */ 132 /* Configure pin mux for ULPI. There is no pin mux for UTMI */
133 if (!strcmp(prop, "ulpi")) { 133 if (prop && !strcmp(prop, "ulpi")) {
134 temp = in_be32(immap + MPC83XX_SICRL_OFFS); 134 temp = in_be32(immap + MPC83XX_SICRL_OFFS);
135 temp &= ~MPC831X_SICRL_USB_MASK; 135 temp &= ~MPC831X_SICRL_USB_MASK;
136 temp |= MPC831X_SICRL_USB_ULPI; 136 temp |= MPC831X_SICRL_USB_ULPI;
@@ -153,13 +153,13 @@ int mpc831x_usb_cfg(void)
153 usb_regs = ioremap(res.start, res.end - res.start + 1); 153 usb_regs = ioremap(res.start, res.end - res.start + 1);
154 154
155 /* Using on-chip PHY */ 155 /* Using on-chip PHY */
156 if (!strcmp(prop, "utmi_wide") || 156 if (prop && (!strcmp(prop, "utmi_wide") ||
157 !strcmp(prop, "utmi")) { 157 !strcmp(prop, "utmi"))) {
158 /* Set UTMI_PHY_EN, REFSEL to 48MHZ */ 158 /* Set UTMI_PHY_EN, REFSEL to 48MHZ */
159 out_be32(usb_regs + FSL_USB2_CONTROL_OFFS, 159 out_be32(usb_regs + FSL_USB2_CONTROL_OFFS,
160 CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ); 160 CONTROL_UTMI_PHY_EN | CONTROL_REFSEL_48MHZ);
161 /* Using external UPLI PHY */ 161 /* Using external UPLI PHY */
162 } else if (!strcmp(prop, "ulpi")) { 162 } else if (prop && !strcmp(prop, "ulpi")) {
163 /* Set PHY_CLK_SEL to ULPI */ 163 /* Set PHY_CLK_SEL to ULPI */
164 temp = CONTROL_PHY_CLK_SEL_ULPI; 164 temp = CONTROL_PHY_CLK_SEL_ULPI;
165#ifdef CONFIG_USB_OTG 165#ifdef CONFIG_USB_OTG