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: <s2y427d64721004192234x96d286e4teab6f32323d2b291@mail.gmail.com>
Date:	Tue, 20 Apr 2010 13:34:18 +0800
From:	Axel Lin <axel.lin@...il.com>
To:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Liam Girdwood <lrg@...mlogic.co.uk>,
	Samuel Ortiz <sameo@...ux.intel.com>
Subject: Re: [PATCH] mc13783-regulator: fix a memory leak in 
	mc13783_regulator_remove

hi Mark,

2010/4/20 Mark Brown <broonie@...nsource.wolfsonmicro.com>:
> On Mon, Apr 19, 2010 at 09:58:02AM +0800, Axel Lin wrote:
>> This patch fixes a memory leak by freeing priv in mc13783_regulator_remove
>
> Acked-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
>
> but note that...
>
>> +       platform_set_drvdata(pdev, NULL);
>> +
>
> This is completely unrelated to what your description says (and is not
> needed).
>

In the probe function , the driver uses platform_set_drvdata(pdev,
priv) to store a pointer to the priv data structure.
To avoid leaving a dangling pointer behind, the driver should clear
the pointer to priv before freeing priv.

Regards,
Axel
--
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