Blame SOURCES/0207-efinet-fix-some-coverity-gripes.patch

a85e8e
From 9bd2624ad05dc1a78a094d48f78e7a8a07deec24 Mon Sep 17 00:00:00 2001
a85e8e
From: Peter Jones <pjones@redhat.com>
a85e8e
Date: Mon, 11 Jul 2016 15:57:28 -0400
a85e8e
Subject: [PATCH 207/260] efinet: fix some coverity gripes.
a85e8e
a85e8e
Related: rhbz#1154226
a85e8e
a85e8e
Signed-off-by: Peter Jones <pjones@redhat.com>
a85e8e
---
a85e8e
 grub-core/net/bootp.c              |  9 +++++----
a85e8e
 grub-core/net/drivers/efi/efinet.c | 11 +++++++----
a85e8e
 2 files changed, 12 insertions(+), 8 deletions(-)
a85e8e
a85e8e
diff --git a/grub-core/net/bootp.c b/grub-core/net/bootp.c
a85e8e
index 4793ebc43..46ce8135a 100644
a85e8e
--- a/grub-core/net/bootp.c
a85e8e
+++ b/grub-core/net/bootp.c
a85e8e
@@ -349,10 +349,11 @@ grub_net_configure_by_dhcpv6_ack (const char *name,
a85e8e
   struct grub_net_network_level_address addr;
a85e8e
   int mask = -1;
a85e8e
 
a85e8e
-  if (device)
a85e8e
-    *device = 0;
a85e8e
-  if (path)
a85e8e
-    *path = 0;
a85e8e
+  if (!device || !path)
a85e8e
+    return NULL;
a85e8e
+
a85e8e
+  *device = 0;
a85e8e
+  *path = 0;
a85e8e
 
a85e8e
   grub_dprintf ("net", "mac address is %02x:%02x:%02x:%02x:%02x:%02x\n",
a85e8e
 		hwaddr->mac[0], hwaddr->mac[1], hwaddr->mac[2],
a85e8e
diff --git a/grub-core/net/drivers/efi/efinet.c b/grub-core/net/drivers/efi/efinet.c
a85e8e
index ed103df7a..2244f1403 100644
a85e8e
--- a/grub-core/net/drivers/efi/efinet.c
a85e8e
+++ b/grub-core/net/drivers/efi/efinet.c
a85e8e
@@ -401,6 +401,7 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
a85e8e
     if (pxe_mode->using_ipv6)
a85e8e
       {
a85e8e
 	grub_net_link_level_address_t hwaddr;
a85e8e
+	struct grub_net_network_level_interface *intf;
a85e8e
 
a85e8e
 	grub_dprintf ("efinet", "using ipv6 and dhcpv6\n");
a85e8e
 	grub_dprintf ("efinet", "dhcp_ack_received: %s%s\n",
a85e8e
@@ -414,10 +415,12 @@ grub_efi_net_config_real (grub_efi_handle_t hnd, char **device,
a85e8e
 		     card->efi_net->mode->current_address,
a85e8e
 		     sizeof (hwaddr.mac));
a85e8e
 
a85e8e
-	grub_net_configure_by_dhcpv6_ack (card->name, card, 0,
a85e8e
-					  &hwaddr, &pxe_mode->dhcp_ack.dhcpv6,
a85e8e
-					  1, device, path);
a85e8e
-	grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path);
a85e8e
+	intf = grub_net_configure_by_dhcpv6_ack (card->name, card, 0,
a85e8e
+						 &hwaddr,
a85e8e
+						 &pxe_mode->dhcp_ack.dhcpv6,
a85e8e
+						 1, device, path);
a85e8e
+	if (intf && device && path)
a85e8e
+	  grub_dprintf ("efinet", "device: `%s' path: `%s'\n", *device, *path);
a85e8e
       }
a85e8e
     else
a85e8e
       {
a85e8e
-- 
a85e8e
2.13.0
a85e8e