aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-sony.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b60bc38903db..f57ab5e2832f 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -585,6 +585,7 @@ static int sony_leds_init(struct hid_device *hdev)
585 led = kzalloc(sizeof(struct led_classdev) + name_sz, GFP_KERNEL); 585 led = kzalloc(sizeof(struct led_classdev) + name_sz, GFP_KERNEL);
586 if (!led) { 586 if (!led) {
587 hid_err(hdev, "Couldn't allocate memory for LED %d\n", n); 587 hid_err(hdev, "Couldn't allocate memory for LED %d\n", n);
588 ret = -ENOMEM;
588 goto error_leds; 589 goto error_leds;
589 } 590 }
590 591
@@ -596,7 +597,8 @@ static int sony_leds_init(struct hid_device *hdev)
596 led->brightness_get = sony_led_get_brightness; 597 led->brightness_get = sony_led_get_brightness;
597 led->brightness_set = sony_led_set_brightness; 598 led->brightness_set = sony_led_set_brightness;
598 599
599 if (led_classdev_register(&hdev->dev, led)) { 600 ret = led_classdev_register(&hdev->dev, led);
601 if (ret) {
600 hid_err(hdev, "Failed to register LED %d\n", n); 602 hid_err(hdev, "Failed to register LED %d\n", n);
601 kfree(led); 603 kfree(led);
602 goto error_leds; 604 goto error_leds;