]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: batman-adv: Don't write in not allocated packet_buff
authorSven Eckelmann <sven.eckelmann@gmx.de>
Sat, 21 Aug 2010 12:18:10 +0000 (14:18 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Aug 2010 01:15:38 +0000 (18:15 -0700)
commit12df2ac3e7c90e3386edf44458041c563a060f53
tree3eb64c2a22559d122e636171dac50a33c66ae456
parentd9e0fc06dc36500225bb0ba8beda76a618dca4f0
Staging: batman-adv: Don't write in not allocated packet_buff

Each net_device in a system will automatically managed as a possible
batman_if and holds different informations like a buffer with a prepared
originator messages. To reduce the memory usage, the packet_buff will
only be allocated when the interface is really added/enabled for
batman-adv.

The function to update the hw address information inside the packet_buff
just assumes that the packet_buff is always initialised and thus the
kernel will just oops when we try to change the hw address of a not
already fully enabled interface.

We must always check if the packet_buff is allocated before we try to
change information inside of it.

Reported-by: Tim Glaremin <Tim.Glaremin@web.de>
Reported-by: Kazuki Shimada <zukky@bb.banban.jp>
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/hard-interface.c