image: Fix image_missing_values_from_name
This commit is contained in:
1 parent
1736afae69
commit
1ba42ce46f
1 file changed
+6
-2
+6
-2
@@ -42,6 +42,7 @@ static void image_missing_values_from_name(struct image * image, const char * na
|
|||||||
char * device = NULL;
|
char * device = NULL;
|
||||||
char * hwrevs = NULL;
|
char * hwrevs = NULL;
|
||||||
char * version = NULL;
|
char * version = NULL;
|
||||||
|
enum device new_device;
|
||||||
|
|
||||||
str = strdup(name);
|
str = strdup(name);
|
||||||
if ( ! str )
|
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);
|
image->type = image_type_from_string(type);
|
||||||
free(type);
|
free(type);
|
||||||
|
|
||||||
if ( ! image->device || image->device == DEVICE_ANY )
|
if ( ! image->device || image->device == DEVICE_ANY ) {
|
||||||
image->device = device_from_string(device);
|
new_device = device_from_string(device);
|
||||||
|
if ( new_device )
|
||||||
|
image->device = new_device;
|
||||||
|
}
|
||||||
free(device);
|
free(device);
|
||||||
|
|
||||||
if ( ! image->hwrevs )
|
if ( ! image->hwrevs )
|
||||||
|
|||||||
Reference in new issue
Block a user