mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-25 16:49:23 +00:00
net/pxe: fix error condition
Test return value of grub_netbuff_reserve(), buf itself cannot be NULL here. Found by: Coverity scan.
This commit is contained in:
1 parent
7aaed66455
commit
12abe75aa0
1 file changed
+1
-2
@@ -218,8 +218,7 @@ grub_pxe_recv (struct grub_net_card *dev __attribute__ ((unused)))
|
|||||||
return NULL;
|
return NULL;
|
||||||
/* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible
|
/* Reserve 2 bytes so that 2 + 14/18 bytes of ethernet header is divisible
|
||||||
by 4. So that IP header is aligned on 4 bytes. */
|
by 4. So that IP header is aligned on 4 bytes. */
|
||||||
grub_netbuff_reserve (buf, 2);
|
if (grub_netbuff_reserve (buf, 2))
|
||||||
if (!buf)
|
|
||||||
{
|
{
|
||||||
grub_netbuff_free (buf);
|
grub_netbuff_free (buf);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in new issue
Block a user