All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <anton@enomsg.org>
To: Shuah Khan <shuah.kh@samsung.com>
Cc: dwmw2@infradead.org, rostedt@goodmis.org, fweisbec@gmail.com,
	mingo@redhat.com, rjw@rjwysocki.net, gregkh@linuxfoundation.org,
	linux-kernel@vger.kernel.org, shuahkhan@gmail.com,
	stable@vger.kernel.org
Subject: Re: [PATCH v3 1/2] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate
Date: Sun, 1 Dec 2013 13:50:13 -0800	[thread overview]
Message-ID: <20131201215012.GA6271@lizard> (raw)
In-Reply-To: <739760cf69fca695a825246b5f6f1849cd2cf57a.1385138418.git.shuah.kh@samsung.com>

On Fri, Nov 22, 2013 at 10:54:28AM -0700, Shuah Khan wrote:
> power_supply_register() calls device_init_wakeup() to register a wakeup
> source before initializing dev_name. As a result, device_wakeup_enable()
> end up registering wakeup source with a null name when wakeup_source_register()
> gets called with dev_name(dev) which is null at the time.
> 
> When kernel is booted with wakeup_source_activate enabled, it will panic
> when the trace point code tries to dereference ws->name.
> 
> Fixed the problem by moving up the kobject_set_name() call prior to accesses
> to dev_name(). Replaced kobject_set_name() with dev_set_name() which is the
> right interface to be called from drivers. Fixed the call to device_del() prior
> to device_add() in for wakeup_init_failed error handling code.

Applied, thanks a lot!

Anton

  reply	other threads:[~2013-12-01 21:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 17:54 [PATCH v3 0/2] power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activate Shuah Khan
2013-11-22 17:54 ` [PATCH v3 1/2] " Shuah Khan
2013-12-01 21:50   ` Anton Vorontsov [this message]
2013-11-22 17:54 ` [PATCH v3 2/2] tracing: Fix Oops from NULL pointer dereference from __assign_str Shuah Khan
2013-11-22 22:18   ` Rafael J. Wysocki
2013-11-26 14:46     ` Steven Rostedt
2013-11-26 15:07       ` Shuah Khan

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=20131201215012.GA6271@lizard \
    --to=anton@enomsg.org \
    --cc=dwmw2@infradead.org \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=rostedt@goodmis.org \
    --cc=shuah.kh@samsung.com \
    --cc=shuahkhan@gmail.com \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.