Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7440
b: refs/heads/master
c: c3c7120
h: refs/heads/master
v: v3
  • Loading branch information
Andrey Panin authored and Linus Torvalds committed Sep 7, 2005
1 parent 96bfad2 commit 63fd5a0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e70b9a3d68909ad7e79bf6e1b0dcec6de922a7c
refs/heads/master: c3c7120d552989be94c9137989be5abb6da8954f
39 changes: 23 additions & 16 deletions trunk/arch/i386/kernel/dmi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,25 @@ struct dmi_header {
static char * __init dmi_string(struct dmi_header *dm, u8 s)
{
u8 *bp = ((u8 *) dm) + dm->length;
char *str = "";

if (!s)
return "";
s--;
while (s > 0 && *bp) {
bp += strlen(bp) + 1;
if (s) {
s--;
}
return bp;
while (s > 0 && *bp) {
bp += strlen(bp) + 1;
s--;
}

if (*bp != 0) {
str = alloc_bootmem(strlen(bp) + 1);
if (str != NULL)
strcpy(str, bp);
else
printk(KERN_ERR "dmi_string: out of memory.\n");
}
}

return str;
}

/*
Expand Down Expand Up @@ -84,19 +94,16 @@ static char *dmi_ident[DMI_STRING_MAX];
*/
static void __init dmi_save_ident(struct dmi_header *dm, int slot, int string)
{
char *d = (char*)dm;
char *p = dmi_string(dm, d[string]);
char *p, *d = (char*) dm;

if (p == NULL || *p == 0)
return;
if (dmi_ident[slot])
return;

dmi_ident[slot] = alloc_bootmem(strlen(p) + 1);
if(dmi_ident[slot])
strcpy(dmi_ident[slot], p);
else
printk(KERN_ERR "dmi_save_ident: out of memory.\n");
p = dmi_string(dm, d[string]);
if (p == NULL)
return;

dmi_ident[slot] = p;
}

/*
Expand Down

0 comments on commit 63fd5a0

Please sign in to comment.