+ lib-parserc-switch-match_number-over-to-use-match_strdup.patch added to -mm tree

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

 



The patch titled
     Subject: lib/parser.c: switch match_number() over to use match_strdup()
has been added to the -mm tree.  Its filename is
     lib-parserc-switch-match_number-over-to-use-match_strdup.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-parserc-switch-match_number-over-to-use-match_strdup.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-parserc-switch-match_number-over-to-use-match_strdup.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: Eric Biggers <ebiggers@xxxxxxxxxx>
Subject: lib/parser.c: switch match_number() over to use match_strdup()

This simplifies the code.  No change in behavior.

Link: http://lkml.kernel.org/r/20180830194727.191555-1-ebiggers@xxxxxxxxxx
Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 lib/parser.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

--- a/lib/parser.c~lib-parserc-switch-match_number-over-to-use-match_strdup
+++ a/lib/parser.c
@@ -131,13 +131,10 @@ static int match_number(substring_t *s,
 	char *buf;
 	int ret;
 	long val;
-	size_t len = s->to - s->from;
 
-	buf = kmalloc(len + 1, GFP_KERNEL);
+	buf = match_strdup(s);
 	if (!buf)
 		return -ENOMEM;
-	memcpy(buf, s->from, len);
-	buf[len] = '\0';
 
 	ret = 0;
 	val = simple_strtol(buf, &endp, base);
_

Patches currently in -mm which might be from ebiggers@xxxxxxxxxx are

lib-parserc-switch-match_strdup-over-to-use-kmemdup_nul.patch
lib-parserc-switch-match_u64int-over-to-use-match_strdup.patch
lib-parserc-switch-match_number-over-to-use-match_strdup.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