]> git.baikalelectronics.ru Git - kernel.git/commit
dp83640: Fix length check for event timestamp status messages
authorChristian Riesch <christian.riesch@omicron.at>
Thu, 21 Aug 2014 13:17:04 +0000 (15:17 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 Aug 2014 19:33:48 +0000 (12:33 -0700)
commit6c2a40c80edbe08f6353814eb8b6f65b6746543d
treec5e1908dee1dbef590c83cd6a188a4927e1da80c
parente7edcb2e75cfc57e3f14772df2d2e576db0fd185
dp83640: Fix length check for event timestamp status messages

Event timestamp status messages have a variable length, ranging from
1 to 5 words (16 bit words). The current code however requires
a minimum message length of sizeof(*phy_txts). In most cases this
condition is fulfilled due to padding bytes. However, if several events
are signaled in a single message, padding bytes may not be present.
For short event timestamp status messages, the length check will fail,
and the event timestamp will be dropped.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/dp83640.c