NFC: st21nfca: Add condition to make sure atr_req->length is valid.
authorChristophe Ricard <christophe.ricard@gmail.com>
Sun, 10 Aug 2014 22:04:56 +0000 (00:04 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sun, 7 Sep 2014 22:07:44 +0000 (00:07 +0200)
commit56f1ffcccd784672654918f9214979b4918c2544
tree9a7015cf87cc64844792febb32d0cd8e75124cb3
parenta51577c9e3c49dbc44c821f9e170b96bbea716e3
NFC: st21nfca: Add condition to make sure atr_req->length is valid.

gb_len in st21nfca_tm_send_atr_res can be negative. Not checking for
that could lead to a potential kernel oops.
We now make sure that atr_req->length > sizeof(struct st21nfca_atr_req)
to avoid such situation.

Signed-off-by: Christophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/nfc/st21nfca/st21nfca_dep.c