diff options
author | Eugeni Dodonov <eugeni@mandriva.com> | 2009-12-23 07:27:22 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-20 18:05:25 -0500 |
commit | 20633bf0141c5e93e3396770d5eb7d200ee4068a (patch) | |
tree | d542a1a11693c4820cbcb58a23d25eec76df0024 /drivers | |
parent | 24bc7347da73a9ed3383056c3d0f28c0e361621e (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/asus_oled/asus_oled.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c index f4c26572c7df..43c57b7688ab 100644 --- a/drivers/staging/asus_oled/asus_oled.c +++ b/drivers/staging/asus_oled/asus_oled.c | |||
@@ -194,9 +194,11 @@ static ssize_t set_enabled(struct device *dev, struct device_attribute *attr, | |||
194 | { | 194 | { |
195 | struct usb_interface *intf = to_usb_interface(dev); | 195 | struct usb_interface *intf = to_usb_interface(dev); |
196 | struct asus_oled_dev *odev = usb_get_intfdata(intf); | 196 | struct asus_oled_dev *odev = usb_get_intfdata(intf); |
197 | int temp = strict_strtoul(buf, 10, NULL); | 197 | unsigned long value; |
198 | if (strict_strtoul(buf, 10, &value)) | ||
199 | return -EINVAL; | ||
198 | 200 | ||
199 | enable_oled(odev, temp); | 201 | enable_oled(odev, value); |
200 | 202 | ||
201 | return count; | 203 | return count; |
202 | } | 204 | } |
@@ -207,10 +209,12 @@ static ssize_t class_set_enabled(struct device *device, | |||
207 | { | 209 | { |
208 | struct asus_oled_dev *odev = | 210 | struct asus_oled_dev *odev = |
209 | (struct asus_oled_dev *) dev_get_drvdata(device); | 211 | (struct asus_oled_dev *) dev_get_drvdata(device); |
212 | unsigned long value; | ||
210 | 213 | ||
211 | int temp = strict_strtoul(buf, 10, NULL); | 214 | if (strict_strtoul(buf, 10, &value)) |
215 | return -EINVAL; | ||
212 | 216 | ||
213 | enable_oled(odev, temp); | 217 | enable_oled(odev, value); |
214 | 218 | ||
215 | return count; | 219 | return count; |
216 | } | 220 | } |