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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2016 16:25:22 +0000 (10:25 -0600)
commit582ab27a063a506ccb55fc48afcc325342a2deba
tree022881574d27b4ef75f42ca1da13d1bea27fe1d9
parenta909d3e636995ba7c349e2ca5dbb528154d4ac30
mei: bus: fix received data size check in NFC fixup

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

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/bus-fixup.c
drivers/nfc/mei_phy.c