projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e76aec
)
auxdisplay: linedisp: Use kmemdup_nul() helper
author
Geert Uytterhoeven
<geert@linux-m68k.org>
Tue, 19 Oct 2021 14:45:06 +0000
(16:45 +0200)
committer
Miguel Ojeda
<ojeda@kernel.org>
Thu, 21 Oct 2021 21:36:29 +0000
(23:36 +0200)
Use the existing kmemdup_nul() helper instead of open-coding the same
operation.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
drivers/auxdisplay/line-display.c
patch
|
blob
|
history
diff --git
a/drivers/auxdisplay/line-display.c
b/drivers/auxdisplay/line-display.c
index 4b97c20ac0b381ee67d0c58581c6c316b902c5c4..3f35199bc39f511fc3f6b67b1d1f894ce24b4a95 100644
(file)
--- a/
drivers/auxdisplay/line-display.c
+++ b/
drivers/auxdisplay/line-display.c
@@
-91,13
+91,10
@@
static int linedisp_display(struct linedisp *linedisp, const char *msg,
return 0;
}
- new_msg = km
alloc(count + 1
, GFP_KERNEL);
+ new_msg = km
emdup_nul(msg, count
, GFP_KERNEL);
if (!new_msg)
return -ENOMEM;
- memcpy(new_msg, msg, count);
- new_msg[count] = 0;
-
kfree(linedisp->message);
linedisp->message = new_msg;