Skip to content

Commit

Permalink
linux/ofpath: Fix error handling.
Browse files Browse the repository at this point in the history
Found by: Coverity Scan.
  • Loading branch information
phcoder committed Jan 27, 2015
1 parent c2fc419 commit 8f95eae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions grub-core/osdep/linux/ofpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ vendor_is_ATA(const char *path)
}

static void
check_sas (char *sysfs_path, int *tgt, unsigned long int *sas_address)
check_sas (const char *sysfs_path, int *tgt, unsigned long int *sas_address)
{
char *ed = strstr (sysfs_path, "end_device");
char *p, *q, *path;
Expand All @@ -346,8 +346,10 @@ check_sas (char *sysfs_path, int *tgt, unsigned long int *sas_address)
return;

/* SAS devices are identified using disk@$PHY_ID */
p = strdup (sysfs_path);
p = xstrdup (sysfs_path);
ed = strstr(p, "end_device");
if (!ed)
return;

q = ed;
while (*q && *q != '/')
Expand Down

0 comments on commit 8f95eae

Please sign in to comment.