summaryrefslogtreecommitdiff
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-05-06 08:11:20 +0800
commita4cbe9106927be1c8c53315a7a23c9cb19cf82ef (patch)
treed582d407f0e4c3444a6c1ddef5f9df1198cd4722
parent86ce33a2d2c7827823e649e3c2b27aedc58ca30a (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>
-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];
}
}