diff options
-rw-r--r-- | drivers/input/mouse/trackpoint.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c index ae5871a0e060..9ab5b5ea809d 100644 --- a/drivers/input/mouse/trackpoint.c +++ b/drivers/input/mouse/trackpoint.c | |||
@@ -293,6 +293,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties) | |||
293 | struct ps2dev *ps2dev = &psmouse->ps2dev; | 293 | struct ps2dev *ps2dev = &psmouse->ps2dev; |
294 | unsigned char firmware_id; | 294 | unsigned char firmware_id; |
295 | unsigned char button_info; | 295 | unsigned char button_info; |
296 | int error; | ||
296 | 297 | ||
297 | if (trackpoint_start_protocol(psmouse, &firmware_id)) | 298 | if (trackpoint_start_protocol(psmouse, &firmware_id)) |
298 | return -1; | 299 | return -1; |
@@ -305,7 +306,7 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties) | |||
305 | button_info = 0; | 306 | button_info = 0; |
306 | } | 307 | } |
307 | 308 | ||
308 | psmouse->private = priv = kcalloc(1, sizeof(struct trackpoint_data), GFP_KERNEL); | 309 | psmouse->private = priv = kzalloc(sizeof(struct trackpoint_data), GFP_KERNEL); |
309 | if (!priv) | 310 | if (!priv) |
310 | return -1; | 311 | return -1; |
311 | 312 | ||
@@ -318,7 +319,14 @@ int trackpoint_detect(struct psmouse *psmouse, int set_properties) | |||
318 | trackpoint_defaults(priv); | 319 | trackpoint_defaults(priv); |
319 | trackpoint_sync(psmouse); | 320 | trackpoint_sync(psmouse); |
320 | 321 | ||
321 | sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group); | 322 | error = sysfs_create_group(&ps2dev->serio->dev.kobj, &trackpoint_attr_group); |
323 | if (error) { | ||
324 | printk(KERN_ERR | ||
325 | "trackpoint.c: failed to create sysfs attributes, error: %d\n", | ||
326 | error); | ||
327 | kfree(priv); | ||
328 | return -1; | ||
329 | } | ||
322 | 330 | ||
323 | printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n", | 331 | printk(KERN_INFO "IBM TrackPoint firmware: 0x%02x, buttons: %d/%d\n", |
324 | firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f); | 332 | firmware_id, (button_info & 0xf0) >> 4, button_info & 0x0f); |