Linux MM tree latest commits
 help / color / mirror / Atom feed
* + char-add-warn_on-in-misc_deregister.patch added to -mm tree
@ 2010-06-02 20:11 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2010-06-02 20:11 UTC (permalink / raw)
  To: mm-commits; +Cc: akinobu.mita, heiko.carstens, schwidefsky


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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-06-02 20:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-02 20:11 + char-add-warn_on-in-misc_deregister.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox