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: Eugeni Dodonov <eugeni@mandriva.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by Eugeni Dodonov and committed by Greg Kroah-Hartman 20633bf0 24bc7347

+8 -4
+8 -4
drivers/staging/asus_oled/asus_oled.c
··· 194 { 195 struct usb_interface *intf = to_usb_interface(dev); 196 struct asus_oled_dev *odev = usb_get_intfdata(intf); 197 - int temp = strict_strtoul(buf, 10, NULL); 198 199 - enable_oled(odev, temp); 200 201 return count; 202 } ··· 209 { 210 struct asus_oled_dev *odev = 211 (struct asus_oled_dev *) dev_get_drvdata(device); 212 213 - int temp = strict_strtoul(buf, 10, NULL); 214 215 - enable_oled(odev, temp); 216 217 return count; 218 }
··· 194 { 195 struct usb_interface *intf = to_usb_interface(dev); 196 struct asus_oled_dev *odev = usb_get_intfdata(intf); 197 + unsigned long value; 198 + if (strict_strtoul(buf, 10, &value)) 199 + return -EINVAL; 200 201 + enable_oled(odev, value); 202 203 return count; 204 } ··· 207 { 208 struct asus_oled_dev *odev = 209 (struct asus_oled_dev *) dev_get_drvdata(device); 210 + unsigned long value; 211 212 + if (strict_strtoul(buf, 10, &value)) 213 + return -EINVAL; 214 215 + enable_oled(odev, value); 216 217 return count; 218 }