mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
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: 59fcd7c63a (mei: nfc: Initial nfc implementation)
Signed-off-by: Alexander Usyskin <[email protected]>
Signed-off-by: Tomas Winkler <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
a909d3e636
commit
582ab27a06
2 changed files with 2 additions and 2 deletions
|
|
@ -133,7 +133,7 @@ static int mei_nfc_if_version(struct nfc_mei_phy *phy)
|
|||
return -ENOMEM;
|
||||
|
||||
bytes_recv = mei_cldev_recv(phy->cldev, (u8 *)reply, if_version_length);
|
||||
if (bytes_recv < 0 || bytes_recv < sizeof(struct mei_nfc_reply)) {
|
||||
if (bytes_recv < 0 || bytes_recv < if_version_length) {
|
||||
pr_err("Could not read IF version\n");
|
||||
r = -EIO;
|
||||
goto err;
|
||||
|
|
|
|||
Loading…
Reference in a new issue