Skip to content

Commit

Permalink
solos: Fix under-allocation of skb size for get/set parameters
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 27, 2009
1 parent af78065 commit 3456b22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/atm/solos-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3456b22

Please sign in to comment.