Index: uspace/lib/usbdev/src/recognise.c
===================================================================
--- uspace/lib/usbdev/src/recognise.c	(revision 2bdf92a5421dca631f166390174abc1a586d1c26)
+++ uspace/lib/usbdev/src/recognise.c	(revision dfeb4e22456c87386fa60f7ec044d07663801acb)
@@ -88,10 +88,12 @@
 		char *str = NULL; \
 		int __rc = asprintf(&str, format, ##__VA_ARGS__); \
-		if (__rc > 0) { \
-			__rc = usb_add_match_id((match_ids), (score), str); \
-		} \
-		if (__rc != EOK) { \
-			free(str); \
-			return __rc; \
+		if (__rc >= 0) { \
+			int __rc = usb_add_match_id((match_ids), (score), str); \
+			if (__rc != EOK) { \
+				free(str); \
+				return __rc; \
+			} \
+		} else { \
+			return ENOMEM; \
 		} \
 	} while (0)
