diff options
author | Christophe Ricard <christophe.ricard@gmail.com> | 2014-03-31 18:34:02 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2014-04-21 18:37:29 -0400 |
commit | e8efab6e6bad1bb116bb9dfa6e0f65dd1bb9cc0e (patch) | |
tree | 8cacae1fd7633d12fbf7a5c394fdf7764f3e570a /drivers/nfc | |
parent | 74157ef54c57b2bfbb267c6b8e25f85e01e4b8bb (diff) |
NFC: st21nfca: Fix warning: array subscript is above array bounds
Fix "warning: array subscript is above array bounds" in load_session
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc')
-rw-r--r-- | drivers/nfc/st21nfca/st21nfca.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nfc/st21nfca/st21nfca.c b/drivers/nfc/st21nfca/st21nfca.c index 32d5e8742ee8..d9fe09ea26a5 100644 --- a/drivers/nfc/st21nfca/st21nfca.c +++ b/drivers/nfc/st21nfca/st21nfca.c | |||
@@ -167,14 +167,14 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev) | |||
167 | * - destination hid (1byte) | 167 | * - destination hid (1byte) |
168 | * - destination gid (1byte) | 168 | * - destination gid (1byte) |
169 | */ | 169 | */ |
170 | info = (struct st21nfca_pipe_info *) | 170 | info = (struct st21nfca_pipe_info *) skb_pipe_info->data; |
171 | skb_pipe_info->data; | ||
172 | for (j = 0; (j < ARRAY_SIZE(st21nfca_gates)) && | 171 | for (j = 0; (j < ARRAY_SIZE(st21nfca_gates)) && |
173 | (st21nfca_gates[j].gate != info->dst_gate_id); | 172 | (st21nfca_gates[j].gate != info->dst_gate_id); |
174 | j++) | 173 | j++) |
175 | ; | 174 | ; |
176 | 175 | ||
177 | if (st21nfca_gates[j].gate == info->dst_gate_id && | 176 | if (j < ARRAY_SIZE(st21nfca_gates) && |
177 | st21nfca_gates[j].gate == info->dst_gate_id && | ||
178 | ST21NFCA_DM_IS_PIPE_OPEN(info->pipe_state)) { | 178 | ST21NFCA_DM_IS_PIPE_OPEN(info->pipe_state)) { |
179 | st21nfca_gates[j].pipe = pipe_info[2]; | 179 | st21nfca_gates[j].pipe = pipe_info[2]; |
180 | hdev->gate2pipe[st21nfca_gates[j].gate] = | 180 | hdev->gate2pipe[st21nfca_gates[j].gate] = |