vt-d: Fix PCI=device parsing.

Signed-off-by: Weidong Han <weidong.han@intel.com>
This commit is contained in:
Keir Fraser committed 2007-10-22 14:26:45 +01:00
1 parent bdeaa9684d
commit de91f88afe
2 files changed
+8 -8

No files matched your search

+4 -4
View File
@@ -543,11 +543,10 @@ static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
{
char *token;
token = strchr(*str, ',');
if ( !token )
if ( !(*str) || !strchr(*str, ',') )
return 0;
token++;
token = *str;
*seg = token_value(token);
token = strchr(token, ',') + 1;
*bus = token_value(token);
@@ -555,8 +554,9 @@ static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
*dev = token_value(token);
token = strchr(token, ',') + 1;
*func = token_value(token);
token = strchr(token, ',');
*str = token ? token + 1 : NULL;
*str = token;
return 1;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.