grub2/0191-commands-macbless-Handle-device-opening-errors-corre.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

39 lines
1.0 KiB
Diff

From 72bbd8046a55f4a7995535696f375e465ccb0237 Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sat, 24 Jan 2015 21:15:14 +0100
Subject: [PATCH 191/506] commands/macbless: Handle device opening errors
correctly.
Wrong variable was checked for errors.
Found by: Coverity scan.
---
grub-core/commands/macbless.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/grub-core/commands/macbless.c b/grub-core/commands/macbless.c
index f9e01b6..18efa1a 100644
--- a/grub-core/commands/macbless.c
+++ b/grub-core/commands/macbless.c
@@ -183,7 +183,7 @@ grub_cmd_macbless (grub_command_t cmd, int argc, char **args)
{
char *device_name;
char *path = 0;
- grub_device_t dev;
+ grub_device_t dev = 0;
grub_err_t err;
if (argc != 1)
@@ -197,7 +197,7 @@ grub_cmd_macbless (grub_command_t cmd, int argc, char **args)
else
path = path + 1;
- if (!path || *path == 0 || !device_name)
+ if (!path || *path == 0 || !dev)
{
if (dev)
grub_device_close (dev);
--
2.4.3