solos: Fix under-allocation of skb size for get/set parameters
authorDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 27 Jan 2009 23:39:23 +0000 (10:39 +1100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Tue, 27 Jan 2009 23:39:23 +0000 (10:39 +1100)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/atm/solos-pci.c

index 297869965fc4a582af2cad0d44add8007b01edac..2dca5ffc806314eeb040bcbfdec4917e69445acb 100644 (file)
@@ -159,7 +159,7 @@ static ssize_t solos_param_show(struct device *dev, struct device_attribute *att
 
        buflen = strlen(attr->attr.name) + 10;
 
-       skb = alloc_skb(buflen, GFP_KERNEL);
+       skb = alloc_skb(sizeof(*header) + buflen, GFP_KERNEL);
        if (!skb) {
                dev_warn(&card->dev->dev, "Failed to allocate sk_buff in solos_param_show()\n");
                return -ENOMEM;
@@ -215,7 +215,7 @@ static ssize_t solos_param_store(struct device *dev, struct device_attribute *at
 
        buflen = strlen(attr->attr.name) + 11 + count;
 
-       skb = alloc_skb(buflen, GFP_KERNEL);
+       skb = alloc_skb(sizeof(*header) + buflen, GFP_KERNEL);
        if (!skb) {
                dev_warn(&card->dev->dev, "Failed to allocate sk_buff in solos_param_store()\n");
                return -ENOMEM;