Skip to content
Commit fef5de75 authored by Jerry Ray's avatar Jerry Ray Committed by David S. Miller
Browse files

micrel: ksz8851: fixes struct pointer issue



Issue found during code review. This bug has no impact as long as the
ks8851_net structure is the first element of the ks8851_net_spi structure.
As long as the offset to the ks8851_net struct is zero, the container_of()
macro is subtracting 0 and therefore no damage done. But if the
ks8851_net_spi struct is ever modified such that the ks8851_net struct
within it is no longer the first element of the struct, then the bug would
manifest itself and cause problems.

struct ks8851_net is contained within ks8851_net_spi.
ks is contained within kss.
kss is the priv_data of the netdev structure.

Signed-off-by: default avatarJerry Ray <jerry.ray@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aacd467c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment