mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: akpm@linux-foundation.org,
	"Seung-Woo Kim" <sw0312.kim@samsung.com>,
	"Mark Brown" <broonie@kernel.org>
Subject: [PATCH 3.16 4/7] regulator: core: Fix regualtor_ena_gpio_free not to access pin after freeing
Date: Tue, 27 Jun 2017 12:10:34 +0100	[thread overview]
Message-ID: <lsq.1498561834.500626615@decadent.org.uk> (raw)
In-Reply-To: <lsq.1498561833.742501160@decadent.org.uk>

3.16.45-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Seung-Woo Kim <sw0312.kim@samsung.com>

commit 60a2362f769cf549dc466134efe71c8bf9fbaaba upstream.

After freeing pin from regulator_ena_gpio_free, loop can access
the pin. So this patch fixes not to access pin after freeing.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/regulator/core.c | 2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1709,6 +1709,8 @@ static void regulator_ena_gpio_free(stru
 				gpio_free(pin->gpio);
 				list_del(&pin->list);
 				kfree(pin);
+				rdev->ena_pin = NULL;
+				return;
 			} else {
 				pin->request_count--;
 			}

  parent reply	other threads:[~2017-06-27 11:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 11:10 [PATCH 3.16 0/7] 3.16.45-rc1 review Ben Hutchings
2017-06-27 11:10 ` [PATCH 3.16 5/7] drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl() Ben Hutchings
2017-06-27 11:10 ` Ben Hutchings [this message]
2017-06-27 11:10 ` [PATCH 3.16 3/7] Allow stack to grow up to address space limit Ben Hutchings
2017-06-27 11:10 ` [PATCH 3.16 7/7] KVM: x86: fix singlestepping over syscall Ben Hutchings
2017-06-27 11:10 ` [PATCH 3.16 6/7] rxrpc: Fix several cases where a padded len isn't checked in ticket decode Ben Hutchings
2017-06-27 11:10 ` [PATCH 3.16 1/7] mm: larger stack guard gap, between vmas Ben Hutchings
2017-06-27 11:10 ` [PATCH 3.16 2/7] mm: fix new crash in unmapped_area_topdown() Ben Hutchings
2017-06-27 13:37 ` [PATCH 3.16 0/7] 3.16.45-rc1 review Guenter Roeck
2017-06-27 17:15   ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=lsq.1498561834.500626615@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=sw0312.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®