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>] [day] [month] [year] [list]
Date:	Mon, 04 Feb 2013 10:55:54 +0800
From:	Chen Gang <gang.chen@...anux.com>
To:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	lrg@...com, broonie@...nsource.wolfsonmicro.com,
	Peter Ujfalusi <peter.ujfalusi@...com>,
	Tony Lindgren <tony@...mide.com>
Subject: Fwd: [PATCH] drivers/regulator/twl-*: bettet set NUL after free


 oh, sorry, not sent to mailing-list, originally.
   (this patch should send to public kernel mailing list)

-------- 原始消息 --------
主题: [PATCH] drivers/regulator/twl-*: bettet set NUL after free
日期: Mon, 04 Feb 2013 10:52:30 +0800
发件人: Chen Gang <gang.chen@...anux.com>
收件人: lrg@...com, broonie@...nsource.wolfsonmicro.com,  Peter Ujfalusi <peter.ujfalusi@...com>, Tony Lindgren <tony@...mide.com>


  in .remove function, better to set NUL after free,  just like others.
    in drivers/power/twl4030_charger.c, has already set NULL after free.
    in drivers/input/keyboard/twl4030_keypad.c, has already set NUL after free.

additional info:
  maybe this is not a bug, only for beautify code (can treat it as minor patch)

Signed-off-by: Chen Gang <gang.chen@...anux.com>
---
 drivers/regulator/twl-regulator.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c
index 74508cc..a9ab46a 100644
--- a/drivers/regulator/twl-regulator.c
+++ b/drivers/regulator/twl-regulator.c
@@ -1247,6 +1247,7 @@ static int twlreg_remove(struct platform_device *pdev)
 	struct twlreg_info *info = rdev->reg_data;
 
 	regulator_unregister(rdev);
+	platform_set_drvdata(pdev, NULL);
 	kfree(info);
 	return 0;
 }
-- 
1.7.7.6


--
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