lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1341378617-10386-22-git-send-email-bryan.wu@canonical.com>
Date:	Wed,  4 Jul 2012 13:10:13 +0800
From:	Bryan Wu <bryan.wu@...onical.com>
To:	linux-leds@...r.kernel.org, rpurdie@...ys.net,
	linux-kernel@...r.kernel.org
Subject: [PATCH 21/25] leds: convert transient LED trigger driver to devm_kzalloc()

Cc: Shuah Khan <shuahkhan@...il.com>
Signed-off-by: Bryan Wu <bryan.wu@...onical.com>
---
 drivers/leds/ledtrig-transient.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/leds/ledtrig-transient.c b/drivers/leds/ledtrig-transient.c
index 398f104..8e30b0df 100644
--- a/drivers/leds/ledtrig-transient.c
+++ b/drivers/leds/ledtrig-transient.c
@@ -161,7 +161,8 @@ static void transient_trig_activate(struct led_classdev *led_cdev)
 	int rc;
 	struct transient_trig_data *tdata;
 
-	tdata = kzalloc(sizeof(struct transient_trig_data), GFP_KERNEL);
+	tdata = devm_kzalloc(led_cdev->dev,
+		sizeof(struct transient_trig_data), GFP_KERNEL);
 	if (!tdata) {
 		dev_err(led_cdev->dev,
 			"unable to allocate transient trigger\n");
@@ -194,7 +195,6 @@ err_out_duration:
 err_out:
 	dev_err(led_cdev->dev, "unable to register transient trigger\n");
 	led_cdev->trigger_data = NULL;
-	kfree(tdata);
 }
 
 static void transient_trig_deactivate(struct led_classdev *led_cdev)
@@ -209,7 +209,6 @@ static void transient_trig_deactivate(struct led_classdev *led_cdev)
 		device_remove_file(led_cdev->dev, &dev_attr_state);
 		led_cdev->trigger_data = NULL;
 		led_cdev->activated = false;
-		kfree(transient_data);
 	}
 }
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ