Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8efab6e authored by Christophe Ricard's avatar Christophe Ricard Committed by Samuel Ortiz
Browse files

NFC: st21nfca: Fix warning: array subscript is above array bounds



Fix "warning: array subscript is above array bounds" in load_session

Signed-off-by: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 74157ef5
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -167,14 +167,14 @@ static int st21nfca_hci_load_session(struct nfc_hci_dev *hdev)
		 * - destination hid (1byte)
		 * - destination hid (1byte)
		 * - destination gid (1byte)
		 * - destination gid (1byte)
		 */
		 */
		info = (struct st21nfca_pipe_info *)
		info = (struct st21nfca_pipe_info *) skb_pipe_info->data;
					skb_pipe_info->data;
		for (j = 0; (j < ARRAY_SIZE(st21nfca_gates)) &&
		for (j = 0; (j < ARRAY_SIZE(st21nfca_gates)) &&
			(st21nfca_gates[j].gate != info->dst_gate_id);
			(st21nfca_gates[j].gate != info->dst_gate_id);
			j++)
			j++)
			;
			;


		if (st21nfca_gates[j].gate == info->dst_gate_id &&
		if (j < ARRAY_SIZE(st21nfca_gates) &&
			st21nfca_gates[j].gate == info->dst_gate_id &&
			ST21NFCA_DM_IS_PIPE_OPEN(info->pipe_state)) {
			ST21NFCA_DM_IS_PIPE_OPEN(info->pipe_state)) {
			st21nfca_gates[j].pipe = pipe_info[2];
			st21nfca_gates[j].pipe = pipe_info[2];
			hdev->gate2pipe[st21nfca_gates[j].gate] =
			hdev->gate2pipe[st21nfca_gates[j].gate] =