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-next>] [day] [month] [year] [list]
Message-Id: <baf2a8a669db22f479b72754539183050efdbef5.1506152318.git.arvind.yadav.cs@gmail.com>
Date:   Sat, 23 Sep 2017 13:25:30 +0530
From:   Arvind Yadav <arvind.yadav.cs@...il.com>
To:     rmfrfs@...il.com, johan@...nel.org, elder@...nel.org,
        gregkh@...uxfoundation.org
Cc:     greybus-dev@...ts.linaro.org, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [PATCH v3] staging: greybus: light: Release memory obtained by kasprintf

Free memory region, if gb_lights_channel_config is not successful.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
changes in v2:
            - Subject line changed.
            - add kfree in __gb_lights_led_unregister().
            - No need to check return value of gb_lights_channel_flash_config().

changes ib v3:
            - separate patch for "No need to check return value of
              gb_lights_channel_flash_config()".

 drivers/staging/greybus/light.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c
index 3f4148c..0f538b8 100644
--- a/drivers/staging/greybus/light.c
+++ b/drivers/staging/greybus/light.c
@@ -925,6 +925,8 @@ static void __gb_lights_led_unregister(struct gb_channel *channel)
 		return;
 
 	led_classdev_unregister(cdev);
+	kfree(cdev->name);
+	cdev->name = NULL;
 	channel->led = NULL;
 }
 
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ