+ locking-refcount-use-refcount_warn-to-simplify-code.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: lib/refcount.c: use REFCOUNT_WARN() to simplify code
has been added to the -mm tree.  Its filename is
     locking-refcount-use-refcount_warn-to-simplify-code.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/locking-refcount-use-refcount_warn-to-simplify-code.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/locking-refcount-use-refcount_warn-to-simplify-code.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/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
Subject: lib/refcount.c: use REFCOUNT_WARN() to simplify code

To avoid the check "new > val" appears twice, and make the style
consistent with that in refcount_warn_saturate().

Link: https://lkml.kernel.org/r/20220316125114.1177-1-thunder.leizhen@xxxxxxxxxx
Signed-off-by: Zhen Lei <thunder.leizhen@xxxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Will Deacon <will@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/refcount.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/lib/refcount.c~locking-refcount-use-refcount_warn-to-simplify-code
+++ a/lib/refcount.c
@@ -84,7 +84,7 @@ bool refcount_dec_not_one(refcount_t *r)
 
 		new = val - 1;
 		if (new > val) {
-			WARN_ONCE(new > val, "refcount_t: underflow; use-after-free.\n");
+			REFCOUNT_WARN("underflow; use-after-free");
 			return true;
 		}
 
_

Patches currently in -mm which might be from thunder.leizhen@xxxxxxxxxx are

locking-refcount-use-refcount_warn-to-simplify-code.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux