efinet_dev_init() is missing NULL pointer check

Add missing check of malloc() result.
This commit is contained in:
Toomas Soome 2020-02-20 08:48:34 +00:00
parent af2441fbc7
commit 860545e20b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=358157

View File

@ -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))