diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-04-21 08:23:44 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-05-08 20:56:10 -0400 |
commit | 62c50543cec42592c67d3c9cef5d426aee7c071f (patch) | |
tree | 72223bdf6cb9d8e2ba544c37087a042a9162443d | |
parent | 8b5bed90a508c93835473fd9d5e9a1d60140aac5 (diff) |
wireless: at76c50x: allocating too much data
This is a cut and paste mistake, sizeof(struct mib_local) was intended
instead of sizeof(struct mib_phy). The call to at76_get_mib() uses
sizeof(struct mib_local) correctly, although I changed that to
sizeof(*m) for style reasons after discussion with some of the wireless
maintainers.
The current code works fine because mib_phy structs are larger than
mib_local structs. But we may as well clean it up.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/at76c50x-usb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c index faa8bcb4aac1..3036c0bab056 100644 --- a/drivers/net/wireless/at76c50x-usb.c +++ b/drivers/net/wireless/at76c50x-usb.c | |||
@@ -1122,12 +1122,12 @@ exit: | |||
1122 | static void at76_dump_mib_local(struct at76_priv *priv) | 1122 | static void at76_dump_mib_local(struct at76_priv *priv) |
1123 | { | 1123 | { |
1124 | int ret; | 1124 | int ret; |
1125 | struct mib_local *m = kmalloc(sizeof(struct mib_phy), GFP_KERNEL); | 1125 | struct mib_local *m = kmalloc(sizeof(*m), GFP_KERNEL); |
1126 | 1126 | ||
1127 | if (!m) | 1127 | if (!m) |
1128 | return; | 1128 | return; |
1129 | 1129 | ||
1130 | ret = at76_get_mib(priv->udev, MIB_LOCAL, m, sizeof(struct mib_local)); | 1130 | ret = at76_get_mib(priv->udev, MIB_LOCAL, m, sizeof(*m)); |
1131 | if (ret < 0) { | 1131 | if (ret < 0) { |
1132 | wiphy_err(priv->hw->wiphy, | 1132 | wiphy_err(priv->hw->wiphy, |
1133 | "at76_get_mib (LOCAL) failed: %d\n", ret); | 1133 | "at76_get_mib (LOCAL) failed: %d\n", ret); |