summaryrefslogtreecommitdiff
path: root/common/stdio.c
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-07-06 18:26:12 -0600
committerTom Rini <[email protected]>2026-07-06 18:26:12 -0600
commitee5d46b45ec0c63f8f9dd1e816e0dac3452ccc3d (patch)
tree800cd9e204ca027144070101884c0d5d3c00130f /common/stdio.c
parentece349ade2973e220f524ce59e59711cc919263f (diff)
parenta18265f1ccb7a272721ed4286ed3b5a6182ff424 (diff)
Merge branch 'next'
Diffstat (limited to 'common/stdio.c')
-rw-r--r--common/stdio.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/common/stdio.c b/common/stdio.c
index fc965944209..038e576147b 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -217,27 +217,11 @@ struct stdio_dev *stdio_get_by_name(const char *name)
return NULL;
}
-struct stdio_dev *stdio_clone(struct stdio_dev *dev)
-{
- struct stdio_dev *_dev;
-
- if (!dev)
- return NULL;
-
- _dev = calloc(1, sizeof(struct stdio_dev));
- if (!_dev)
- return NULL;
-
- memcpy(_dev, dev, sizeof(struct stdio_dev));
-
- return _dev;
-}
-
int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp)
{
struct stdio_dev *_dev;
- _dev = stdio_clone(dev);
+ _dev = memdup(dev, sizeof(*dev));
if (!_dev)
return -ENODEV;
list_add_tail(&_dev->list, &devs.list);