nolo: Make sure that nolo_get_device return valid or unknown device

This commit is contained in:
Pali Rohár committed 2012-08-11 09:51:13 +02:00
1 parent e75b963d3a
commit 3c4c0088f0
1 file changed
+3 -1
+3 -1
View File
@@ -121,8 +121,10 @@ enum device nolo_get_device(struct usb_device_info * dev) {
char buf[20]; char buf[20];
if ( nolo_identify_string(dev, "prod_code", buf, sizeof(buf)) < 0 ) if ( nolo_identify_string(dev, "prod_code", buf, sizeof(buf)) < 0 )
return DEVICE_UNKNOWN; return DEVICE_UNKNOWN;
else else if ( buf[0] )
return device_from_string(buf); return device_from_string(buf);
else
return DEVICE_UNKNOWN;
} }