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: <1454010918-29369-1-git-send-email-harald@ccbib.org>
Date:	Thu, 28 Jan 2016 19:55:16 +0000
From:	Harald Geyer <harald@...ib.org>
To:	Liam Girdwood <lgirdwood@...il.com>,
	Mark Brown <broonie@...nel.org>,
	Heiko Stuebner <heiko@...ech.de>
Cc:	linux-kernel@...r.kernel.org, Harald Geyer <harald@...ib.org>
Subject: [PATCH 0/2] regulator: gpio: fix error paths in probe()

Currently resources aren't freed in the order in which they have been
allocated. Eg probe() frees drvdata->states even if it failed before
allocating that. I think allocating/copying the affacted data structures
isn't necessary anyway, so this is the easiest way to fix this.

Patch 1/2 is the actual fix.
Patch 2/2 is minor cleanup while looking at the code.

This series has only been compile tested yet. I will test it on
device-tree HW when I get access to my test equipment. I can't test
non-device-tree code however.

Other notes:
* This driver passes &drvdata->desc uninitialized (but zeroed) to
  of_get_gpio_regulator_config() - I don't know if this is ok.
* I'm not sure if copying config->supply_name is actually necessary,
  so I left that one in.

Harald Geyer (2):
  regulator: gpio: Avoid unnecessarily copying data structures in
    probe()
  regulator: gpio: Move last remaining memory allocation to devres

 drivers/regulator/gpio-regulator.c | 46 +++++++++-----------------------------
 1 file changed, 10 insertions(+), 36 deletions(-)

-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ