diff options
author | Peter Chen <peter.chen@freescale.com> | 2013-03-21 10:12:07 +0800 |
---|---|---|
committer | Peter Chen <peter.chen@freescale.com> | 2013-03-22 13:53:30 +0800 |
commit | 0bee70cb2c9feb641ace4c45c0ec3a6d870ad224 (patch) | |
tree | 37235f678082962850a5bdfb04a12b3b12412e5e /arch/arm/plat-mxc | |
parent | 213da8c8f6a1ef8be73f170d5f742c5609791cbf (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/arm/plat-mxc')
-rwxr-xr-x | arch/arm/plat-mxc/usb_common.c | 6 |
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]; } } |