[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1239030177-28783-3-git-send-email-remi.denis-courmont@nokia.com>
Date: Mon, 6 Apr 2009 18:02:56 +0300
From: Rémi Denis-Courmont
<remi.denis-courmont@...ia.com>
To: netdev@...r.kernel.org
Cc: linux-usb@...r.kernel.org
Subject: [PATCH 3/4] f_phonet: fix inverted memory allocation sizes
From: Rémi Denis-Courmont <remi.denis-courmont@...ia.com>
Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@...ia.com>
---
drivers/usb/gadget/f_phonet.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index dff7bae..25e711f 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -570,9 +570,10 @@ static struct net_device *dev;
int __init phonet_bind_config(struct usb_configuration *c)
{
struct f_phonet *fp;
- int err;
+ int err, size;
- fp = kzalloc(sizeof(*fp), GFP_KERNEL);
+ size = sizeof(*fp) + (phonet_rxq_size * sizeof(struct usb_request *));
+ fp = kzalloc(size, GFP_KERNEL);
if (!fp)
return -ENOMEM;
@@ -597,9 +598,7 @@ int __init gphonet_setup(struct usb_gadget *gadget)
/* Create net device */
BUG_ON(dev);
- dev = alloc_netdev(sizeof(*port)
- + (phonet_rxq_size * sizeof(struct usb_request *)),
- "upnlink%d", pn_net_setup);
+ dev = alloc_netdev(sizeof(*port), "upnlink%d", pn_net_setup);
if (!dev)
return -ENOMEM;
--
1.5.6.5
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists