浏览代码

nfc: st-nci: Free data with irrelevant NDLC PCB_SYNC value

PCB_SYNC different than PCB_TYPE_SUPERVISOR or PCB_TYPE_DATAFRAME
should be discarded.

Irrelevant data may be forwarded up to the ndlc state machine by
phys like spi to prevent missing potential data during "write"
transactions.

Cc: stable@vger.kernel.org
Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Christophe Ricard 10 年之前
父节点
当前提交
8b706884ea
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/nfc/st-nci/ndlc.c

+ 3 - 1
drivers/nfc/st-nci/ndlc.c

@@ -198,8 +198,10 @@ static void llt_ndlc_rcv_queue(struct llt_ndlc *ndlc)
 				kfree_skb(skb);
 				kfree_skb(skb);
 				break;
 				break;
 			}
 			}
-		} else {
+		} else if ((pcb & PCB_TYPE_MASK) == PCB_TYPE_DATAFRAME) {
 			nci_recv_frame(ndlc->ndev, skb);
 			nci_recv_frame(ndlc->ndev, skb);
+		} else {
+			kfree_skb(skb);
 		}
 		}
 	}
 	}
 }
 }