mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
solos: Fix under-allocation of skb size for get/set parameters
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
parent
af7806560c
commit
3456b22111
1 changed files with 2 additions and 2 deletions
|
@ -159,7 +159,7 @@ static ssize_t solos_param_show(struct device *dev, struct device_attribute *att
|
||||||
|
|
||||||
buflen = strlen(attr->attr.name) + 10;
|
buflen = strlen(attr->attr.name) + 10;
|
||||||
|
|
||||||
skb = alloc_skb(buflen, GFP_KERNEL);
|
skb = alloc_skb(sizeof(*header) + buflen, GFP_KERNEL);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
dev_warn(&card->dev->dev, "Failed to allocate sk_buff in solos_param_show()\n");
|
dev_warn(&card->dev->dev, "Failed to allocate sk_buff in solos_param_show()\n");
|
||||||
return -ENOMEM;
|
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;
|
buflen = strlen(attr->attr.name) + 11 + count;
|
||||||
|
|
||||||
skb = alloc_skb(buflen, GFP_KERNEL);
|
skb = alloc_skb(sizeof(*header) + buflen, GFP_KERNEL);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
dev_warn(&card->dev->dev, "Failed to allocate sk_buff in solos_param_store()\n");
|
dev_warn(&card->dev->dev, "Failed to allocate sk_buff in solos_param_store()\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue