projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfa1a74
)
net: mvpp2x: add check after calloc
author
Heinrich Schuchardt
<xypron.glpk@gmx.de>
Wed, 7 Mar 2018 02:39:04 +0000
(
03:39
+0100)
committer
Joe Hershberger
<joe.hershberger@ni.com>
Thu, 22 Mar 2018 20:05:28 +0000
(15:05 -0500)
After allocating plat the pointer is checked.
Afterwards name is allocated and not checked.
Add the missing check to avoid a possible NULL dereference.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/mvpp2.c
patch
|
blob
|
history
diff --git
a/drivers/net/mvpp2.c
b/drivers/net/mvpp2.c
index e3d31a560d54af4697cf8d48d678e878b4dd3fae..62c0c2be0626d36608893467cfd406d76f4db6c5 100644
(file)
--- a/
drivers/net/mvpp2.c
+++ b/
drivers/net/mvpp2.c
@@
-5598,6
+5598,10
@@
static int mvpp2_base_bind(struct udevice *parent)
id += base_id_add;
name = calloc(1, 16);
+ if (!name) {
+ free(plat);
+ return -ENOMEM;
+ }
sprintf(name, "mvpp2-%d", id);
/* Create child device UCLASS_ETH and bind it */