summaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2012-08-12 10:41:38 +0200
committerPali Rohár <pali.rohar@gmail.com>2012-08-12 10:41:38 +0200
commit1ba42ce46f266fd3090a0e6c145f1b2bea580941 (patch)
tree4462426984134ea5aad42db1a16e01bcd97f4fde /src/image.c
parent1736afae695ade6f284c0e10d59d279385bfa21d (diff)
download0xFFFF-1ba42ce46f266fd3090a0e6c145f1b2bea580941.tar.bz2
image: Fix image_missing_values_from_name
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c
index d99f00a..c3a0212 100644
--- a/src/image.c
+++ b/src/image.c
@@ -42,6 +42,7 @@ static void image_missing_values_from_name(struct image * image, const char * na
char * device = NULL;
char * hwrevs = NULL;
char * version = NULL;
+ enum device new_device;
str = strdup(name);
if ( ! str )
@@ -72,8 +73,11 @@ static void image_missing_values_from_name(struct image * image, const char * na
image->type = image_type_from_string(type);
free(type);
- if ( ! image->device || image->device == DEVICE_ANY )
- image->device = device_from_string(device);
+ if ( ! image->device || image->device == DEVICE_ANY ) {
+ new_device = device_from_string(device);
+ if ( new_device )
+ image->device = new_device;
+ }
free(device);
if ( ! image->hwrevs )