+ lib-parserc-switch-match_u64int-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_u64int() over to use match_strdup()
has been added to the -mm tree.  Its filename is
     lib-parserc-switch-match_u64int-over-to-use-match_strdup.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/lib-parserc-switch-match_u64int-over-to-use-match_strdup.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/lib-parserc-switch-match_u64int-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_u64int() over to use match_strdup()

This simplifies the code.  No change in behavior.

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


diff -puN lib/parser.c~lib-parserc-switch-match_u64int-over-to-use-match_strdup lib/parser.c
--- a/lib/parser.c~lib-parserc-switch-match_u64int-over-to-use-match_strdup
+++ a/lib/parser.c
@@ -166,13 +166,10 @@ static int match_u64int(substring_t *s,
 	char *buf;
 	int ret;
 	u64 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 = kstrtoull(buf, base, &val);
 	if (!ret)
_

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

lib-parserc-switch-match_u64int-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