summaryrefslogtreecommitdiff
path: root/common/stdio.c
diff options
context:
space:
mode:
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);