Linux MM tree latest commits
 help / color / mirror / Atom feed
From: akpm@linux-foundation.org
To: mm-commits@vger.kernel.org
Cc: akinobu.mita@gmail.com, heiko.carstens@de.ibm.com,
	schwidefsky@de.ibm.com
Subject: + char-add-warn_on-in-misc_deregister.patch added to -mm tree
Date: Wed, 02 Jun 2010 13:11:11 -0700	[thread overview]
Message-ID: <201006022011.o52KBBah014394@imap1.linux-foundation.org> (raw)


The patch titled
     char: add WARN_ON() in misc_deregister()
has been added to the -mm tree.  Its filename is
     char-add-warn_on-in-misc_deregister.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: char: add WARN_ON() in misc_deregister()
From: Akinobu Mita <akinobu.mita@gmail.com>

misc_deregister() returns an error only when it attempts to unregister
the device that is not registered. This is the driver's bug.

Most of the drivers don't check the return value of misc_deregister().
(It is not bad thing because most of kernel *_unregister() API always
succeed and do not return value)

So it is better to indicate the error by WARN_ON() in misc_deregister().

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/char/misc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/char/misc.c~char-add-warn_on-in-misc_deregister drivers/char/misc.c
--- a/drivers/char/misc.c~char-add-warn_on-in-misc_deregister
+++ a/drivers/char/misc.c
@@ -242,7 +242,7 @@ int misc_deregister(struct miscdevice *m
 {
 	int i = DYNAMIC_MINORS - misc->minor - 1;
 
-	if (list_empty(&misc->list))
+	if (WARN_ON(list_empty(&misc->list)))
 		return -EINVAL;
 
 	mutex_lock(&misc_mtx);
_

Patches currently in -mm which might be from akinobu.mita@gmail.com are

linux-next.patch
kernel-fix-bug_on-checks-for-cpu-notifier-callbacks-direct-call.patch
char-add-warn_on-in-misc_deregister.patch
s390-remove-warn_on-for-misc_deregister-failures.patch


                 reply	other threads:[~2010-06-02 20:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201006022011.o52KBBah014394@imap1.linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=akinobu.mita@gmail.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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