commands/macbless: Handle device opening errors correctly.
Wrong variable was checked for errors. Found by: Coverity scan.
This commit is contained in:
parent
e3b3e53f72
commit
72bbd8046a
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue