summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8952.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-08-08 17:16:01 +0800
committerMatthew Garrett <mjg@redhat.com>2011-10-24 16:52:38 +0200
commite9298028ee69bda44607156e7348cd32f7ab9360 (patch)
tree6ac947db3ddcc1365dc83020b612876f6096f7bd /drivers/regulator/max8952.c
parent5d6afd150321a9e6f1180f5dced9032cce6861ac (diff)
downloadlinux-e9298028ee69bda44607156e7348cd32f7ab9360.tar.bz2
platform-drivers-x86: asus-wmi: fix resource leak in asus_wmi_led_exit
This patch fixes wrong test for successful registered led_classdev, and also fixes a leak due to missing led_classdev_unregister call for asus->kbd_led in asus_wmi_led_exit. device_create returns &struct device pointer on success, or ERR_PTR() on error. Thus if led_classdev_register fails, led_cdev->dev is always not NULL. Thus to unregister a successful registered led_classdev, we should check (!IS_ERR_OR_NULL(asus->tpd_led.dev)) instead of (asus->tpd_led.dev). we use IS_ERR_OR_NULL instead of IS_ERR because if we havn't call led_classdev_register, the led_cdev->dev is NULL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Corentin Chary <corentin.chary@gmail.com> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/regulator/max8952.c')
0 files changed, 0 insertions, 0 deletions