Commit 29a99df1 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

usb: misc: cytherm: don't print on ENOMEM

All kmalloc-based functions print enough information on failures.
Signed-off-by: default avatarWolfram Sang <wsa-dev@sang-engineering.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e83c06e9
...@@ -101,10 +101,8 @@ static ssize_t set_brightness(struct device *dev, struct device_attribute *attr, ...@@ -101,10 +101,8 @@ static ssize_t set_brightness(struct device *dev, struct device_attribute *attr,
int retval; int retval;
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(&cytherm->udev->dev, "out of memory\n");
return 0; return 0;
}
cytherm->brightness = simple_strtoul(buf, NULL, 10); cytherm->brightness = simple_strtoul(buf, NULL, 10);
...@@ -148,10 +146,8 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char ...@@ -148,10 +146,8 @@ static ssize_t show_temp(struct device *dev, struct device_attribute *attr, char
int temp, sign; int temp, sign;
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(&cytherm->udev->dev, "out of memory\n");
return 0; return 0;
}
/* read temperature */ /* read temperature */
retval = vendor_command(cytherm->udev, READ_RAM, TEMP, 0, buffer, 8); retval = vendor_command(cytherm->udev, READ_RAM, TEMP, 0, buffer, 8);
...@@ -192,10 +188,8 @@ static ssize_t show_button(struct device *dev, struct device_attribute *attr, ch ...@@ -192,10 +188,8 @@ static ssize_t show_button(struct device *dev, struct device_attribute *attr, ch
unsigned char *buffer; unsigned char *buffer;
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(&cytherm->udev->dev, "out of memory\n");
return 0; return 0;
}
/* check button */ /* check button */
retval = vendor_command(cytherm->udev, READ_RAM, BUTTON, 0, buffer, 8); retval = vendor_command(cytherm->udev, READ_RAM, BUTTON, 0, buffer, 8);
...@@ -230,10 +224,8 @@ static ssize_t show_port0(struct device *dev, struct device_attribute *attr, cha ...@@ -230,10 +224,8 @@ static ssize_t show_port0(struct device *dev, struct device_attribute *attr, cha
unsigned char *buffer; unsigned char *buffer;
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(&cytherm->udev->dev, "out of memory\n");
return 0; return 0;
}
retval = vendor_command(cytherm->udev, READ_PORT, 0, 0, buffer, 8); retval = vendor_command(cytherm->udev, READ_PORT, 0, 0, buffer, 8);
if (retval) if (retval)
...@@ -257,10 +249,8 @@ static ssize_t set_port0(struct device *dev, struct device_attribute *attr, cons ...@@ -257,10 +249,8 @@ static ssize_t set_port0(struct device *dev, struct device_attribute *attr, cons
int tmp; int tmp;
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(&cytherm->udev->dev, "out of memory\n");
return 0; return 0;
}
tmp = simple_strtoul(buf, NULL, 10); tmp = simple_strtoul(buf, NULL, 10);
...@@ -290,10 +280,8 @@ static ssize_t show_port1(struct device *dev, struct device_attribute *attr, cha ...@@ -290,10 +280,8 @@ static ssize_t show_port1(struct device *dev, struct device_attribute *attr, cha
unsigned char *buffer; unsigned char *buffer;
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(&cytherm->udev->dev, "out of memory\n");
return 0; return 0;
}
retval = vendor_command(cytherm->udev, READ_PORT, 1, 0, buffer, 8); retval = vendor_command(cytherm->udev, READ_PORT, 1, 0, buffer, 8);
if (retval) if (retval)
...@@ -317,10 +305,8 @@ static ssize_t set_port1(struct device *dev, struct device_attribute *attr, cons ...@@ -317,10 +305,8 @@ static ssize_t set_port1(struct device *dev, struct device_attribute *attr, cons
int tmp; int tmp;
buffer = kmalloc(8, GFP_KERNEL); buffer = kmalloc(8, GFP_KERNEL);
if (!buffer) { if (!buffer)
dev_err(&cytherm->udev->dev, "out of memory\n");
return 0; return 0;
}
tmp = simple_strtoul(buf, NULL, 10); tmp = simple_strtoul(buf, NULL, 10);
...@@ -351,10 +337,8 @@ static int cytherm_probe(struct usb_interface *interface, ...@@ -351,10 +337,8 @@ static int cytherm_probe(struct usb_interface *interface,
int retval = -ENOMEM; int retval = -ENOMEM;
dev = kzalloc (sizeof(struct usb_cytherm), GFP_KERNEL); dev = kzalloc (sizeof(struct usb_cytherm), GFP_KERNEL);
if (dev == NULL) { if (!dev)
dev_err (&interface->dev, "Out of memory\n");
goto error_mem; goto error_mem;
}
dev->udev = usb_get_dev(udev); dev->udev = usb_get_dev(udev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment