提交 cb90ee97 编写于 作者: H Heinrich Schuchardt 提交者: Alexander Graf

efi_loader: efi_net: check return value of calloc

Calloc may return NULL. So we must check the return value.
Signed-off-by: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 93945f2c
......@@ -292,6 +292,10 @@ int efi_net_register(void)
/* We only expose the "active" eth device, so one is enough */
netobj = calloc(1, sizeof(*netobj));
if (!netobj) {
printf("ERROR: Out of memory\n");
return 1;
}
/* Fill in object data */
netobj->parent.protocols[0].guid = &efi_net_guid;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册