summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2013-03-21 10:12:07 +0800
committerPeter Chen <peter.chen@freescale.com>2013-03-22 16:34:21 +0800
commit585c7fcb79428edc39faad52d40e64b20d51ba56 (patch)
tree3d0fd853afe31b9d1b23b976f4b0480092759f9e /arch
parent9eb05b3e4b673755b1b6647672e74d3e9436fd17 (diff)
ENGR00255484-1 msl: usb: add NULL poiner check for fsl_xcvr_ops
Add NULL pointer check for global fsl_xcvr_ops Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'arch')
-rwxr-xr-xarch/arm/plat-mxc/usb_common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/plat-mxc/usb_common.c b/arch/arm/plat-mxc/usb_common.c
index a327d3016619..f6acb8af5448 100755
--- a/arch/arm/plat-mxc/usb_common.c
+++ b/arch/arm/plat-mxc/usb_common.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -182,7 +182,7 @@ void fsl_usb_xcvr_unregister(struct fsl_xcvr_ops *xcvr_ops)
pr_debug("%s\n", __func__);
for (i = 0; i < MXC_NUMBER_USB_TRANSCEIVER; i++) {
- if (g_xc_ops[i] == xcvr_ops) {
+ if (g_xc_ops[i] && (g_xc_ops[i] == xcvr_ops)) {
g_xc_ops[i] = NULL;
return;
}
@@ -203,7 +203,7 @@ static struct fsl_xcvr_ops *fsl_usb_get_xcvr(char *name)
}
for (i = 0; i < MXC_NUMBER_USB_TRANSCEIVER; i++) {
- if (strcmp(g_xc_ops[i]->name, name) == 0) {
+ if (g_xc_ops[i] && (strcmp(g_xc_ops[i]->name, name) == 0)) {
return g_xc_ops[i];
}
}