mei: bus: fix received data size check in NFC fixup
authorAlexander Usyskin <alexander.usyskin@intel.com>
Mon, 31 Oct 2016 17:02:39 +0000 (19:02 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:04:04 +0000 (11:04 +0100)
commit2ef72292774600e4b4e1b1dbddf8cba971c9efb3
tree9a7b079e212ee63c2ece1174582a91748e090154
parent0b0d4fc3fbb0f757ff9d84a9ca8508e060851e49
mei: bus: fix received data size check in NFC fixup

commit 582ab27a063a506ccb55fc48afcc325342a2deba upstream.

NFC version reply size checked against only header size, not against
full message size. That may lead potentially to uninitialized memory access
in version data.

That leads to warnings when version data is accessed:
drivers/misc/mei/bus-fixup.c: warning: '*((void *)&ver+11)' may be used uninitialized in this function [-Wuninitialized]:  => 212:2

Reported in
Build regressions/improvements in v4.9-rc3
https://lkml.org/lkml/2016/10/30/57

[js] the check is in 3.12 only once

Fixes: 59fcd7c63abf (mei: nfc: Initial nfc implementation)
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/misc/mei/nfc.c