Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 20633bf0 authored by Eugeni Dodonov's avatar Eugeni Dodonov Committed by Greg Kroah-Hartman
Browse files

Staging: asus_oled: fix oops in 2.6.32.2



After updating to 2.6.32 kernel, I started experiencing Oopses caused by
the asus_oled module. After quick investigation, I wrapped this simple
patch which fixes an Oops in by asus_oled module on 2.6.32.2 kernel,
caused by incorrect usage of strict_strtoul function call within
set_enabled and set_disabled functions. This can be triggered by simple
running the userspace client for asus_old (e.g., 'asusoled -e' or
'asusoled -d').

Signed-off-by: default avatarEugeni Dodonov <eugeni@mandriva.com>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 24bc7347
Loading
Loading
Loading
Loading
+8 −4
Original line number Original line Diff line number Diff line
@@ -194,9 +194,11 @@ static ssize_t set_enabled(struct device *dev, struct device_attribute *attr,
{
{
	struct usb_interface *intf = to_usb_interface(dev);
	struct usb_interface *intf = to_usb_interface(dev);
	struct asus_oled_dev *odev = usb_get_intfdata(intf);
	struct asus_oled_dev *odev = usb_get_intfdata(intf);
	int temp = strict_strtoul(buf, 10, NULL);
	unsigned long value;
	if (strict_strtoul(buf, 10, &value))
		return -EINVAL;


	enable_oled(odev, temp);
	enable_oled(odev, value);


	return count;
	return count;
}
}
@@ -207,10 +209,12 @@ static ssize_t class_set_enabled(struct device *device,
{
{
	struct asus_oled_dev *odev =
	struct asus_oled_dev *odev =
		(struct asus_oled_dev *) dev_get_drvdata(device);
		(struct asus_oled_dev *) dev_get_drvdata(device);
	unsigned long value;


	int temp = strict_strtoul(buf, 10, NULL);
	if (strict_strtoul(buf, 10, &value))
		return -EINVAL;


	enable_oled(odev, temp);
	enable_oled(odev, value);


	return count;
	return count;
}
}