[B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Use (pr|netdev)_<level> macro helpers

Sven Eckelmann sven.eckelmann at gmx.de
Tue Jun 15 22:37:47 UTC 2010


Sven Eckelmann wrote:
[...]
> Found some time to play a little bit around with your patch and noticed
> that it crashes the kernel. I did my tests using following "interesting"
> part:
> 
[...]
> 
> I compiled the module and loaded it using `insmod batman-adv.ko`. This will
> create some files in /sys. Just changed the vis mode to server using:
> 
> echo 0 > /sys/class/net/bat0/mesh/vis_mode
> 
> And then it will crash at that netdev_info call.
> 
> The problem seems to be that dev_printk is used by netdev_printk (which is
> used by netdev_info). netdev_printk will add (netdev)->dev.parent as second
> parameter of dev_printk (and parent is NULL in our case). This macro will
> now call dev_driver_string with NULL as parameter and just dereference
> this null pointer.
> 
> Maybe it is related to something else, but at least I think that this could
> be the cause of the crash.

Something i forgot to say:

As far as I understand, the netdev_* stuff is made to be used by real drivers 
with more or less physical hardware. batman-adv is a virtual bridge used for 
mesh networks. Like net/bridge/ it has no physical parent device and only 
other net_devices are used inside of it - which may have real physical network 
devices as parents.

Please correct me if my assumption is wrong.

Best regards,
	Sven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20100616/dfbae413/attachment.asc>


More information about the devel mailing list