efinet_dev_init() is missing NULL pointer check
Add missing check of malloc() result.
This commit is contained in:
parent
239a5be61c
commit
67dc9f220d
@ -371,6 +371,8 @@ efinet_dev_init()
|
||||
status = BS->LocateHandle(ByProtocol, &sn_guid, NULL, &sz, NULL);
|
||||
if (status == EFI_BUFFER_TOO_SMALL) {
|
||||
handles = (EFI_HANDLE *)malloc(sz);
|
||||
if (handles == NULL)
|
||||
return (ENOMEM);
|
||||
status = BS->LocateHandle(ByProtocol, &sn_guid, NULL, &sz,
|
||||
handles);
|
||||
if (EFI_ERROR(status))
|
||||
|
Loading…
Reference in New Issue
Block a user