]> git.karo-electronics.de Git - karo-tx-linux.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>
Thu, 26 Aug 2010 23:46:23 +0000 (16:46 -0700)
commit964505fabe0410e11cc5487a9a4b17dbec461ffd
treec64f3990907d20a59b8495b71934ba096ca2ac15
parentb6c68ad83cbc3bcf4ff83f62340fbf891f44735c
Staging: batman-adv: Don't write in not allocated packet_buff

commit f86b9984250fa2b71ce36d4693a939a58579583b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/batman-adv/hard-interface.c