diff options
author | Alexander Shiyan <shc_work@mail.ru> | 2013-04-26 20:41:11 +0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-04-30 09:35:55 +0200 |
commit | 32d531574fa46ecb4deee6d4e885e98f527827c4 (patch) | |
tree | ea510782f7cdf28812e4f058c688fbecb6b3a77f | |
parent | ef3e752fa1992cf2fa4b947b240146ebcb712097 (diff) | |
download | barebox-32d531574fa46ecb4deee6d4e885e98f527827c4.tar.gz barebox-32d531574fa46ecb4deee6d4e885e98f527827c4.tar.xz |
MCI: imx: Fix possible null pointer dereference
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/mci/imx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mci/imx.c b/drivers/mci/imx.c index 3d9bd0deb1..c98596434e 100644 --- a/drivers/mci/imx.c +++ b/drivers/mci/imx.c @@ -225,12 +225,13 @@ static int mxcmci_read_response(struct mxcmci_host *host, unsigned int stat) { struct mci_cmd *cmd = host->cmd; int i; - u32 a, b, c; - u32 *resp = (u32 *)cmd->response; + u32 a, b, c, *resp; if (!cmd) return 0; + resp = (u32 *)cmd->response; + if (stat & STATUS_TIME_OUT_RESP) { printf("CMD TIMEOUT\n"); return -ETIMEDOUT; |