]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: Allow zero-length register dumps again
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 21 Jul 2011 22:25:30 +0000 (15:25 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Jul 2011 22:25:30 +0000 (15:25 -0700)
commit61d06a5954b54f33e0b18a970314aba4b4041bb6
tree3644c9018a246df166b220b35d6073efa48a385c
parentd81755319ffc8f95190c5d7ac7bb709412a7ad4e
ethtool: Allow zero-length register dumps again

Some drivers (ab)use the ethtool_ops::get_regs operation to expose
only a hardware revision ID.  Commit
bbd966cc12f8312768439a102264490823d6da99 ('ethtool: Allocate register
dump buffer with vmalloc()') had the side-effect of breaking these, as
vmalloc() returns a null pointer for size=0 whereas kmalloc() did not.

For backward-compatibility, allow zero-length dumps again.

Reported-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Cc: stable@kernel.org [2.6.37+]
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/ethtool.c