Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 278722
b: refs/heads/master
c: f6efe96
h: refs/heads/master
v: v3
  • Loading branch information
Pontus Fuchs authored and Luciano Coelho committed Dec 1, 2011
1 parent 9464dea commit 0764fd2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2131d3c2f99b081806fdae7662c92fe6acda52af
refs/heads/master: f6efe96edd9c41c624c8f4ddbc4930c1a2d8f1e1
14 changes: 14 additions & 0 deletions trunk/drivers/net/wireless/wl12xx/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,9 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
nvs_ptr += 3;

for (i = 0; i < burst_len; i++) {
if (nvs_ptr + 3 >= (u8 *) wl->nvs + nvs_len)
goto out_badnvs;

val = (nvs_ptr[0] | (nvs_ptr[1] << 8)
| (nvs_ptr[2] << 16) | (nvs_ptr[3] << 24));

Expand All @@ -359,6 +362,9 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
nvs_ptr += 4;
dest_addr += 4;
}

if (nvs_ptr >= (u8 *) wl->nvs + nvs_len)
goto out_badnvs;
}

/*
Expand All @@ -370,6 +376,10 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)
*/
nvs_ptr = (u8 *)wl->nvs +
ALIGN(nvs_ptr - (u8 *)wl->nvs + 7, 4);

if (nvs_ptr >= (u8 *) wl->nvs + nvs_len)
goto out_badnvs;

nvs_len -= nvs_ptr - (u8 *)wl->nvs;

/* Now we must set the partition correctly */
Expand All @@ -385,6 +395,10 @@ static int wl1271_boot_upload_nvs(struct wl1271 *wl)

kfree(nvs_aligned);
return 0;

out_badnvs:
wl1271_error("nvs data is malformed");
return -EILSEQ;
}

static void wl1271_boot_enable_interrupts(struct wl1271 *wl)
Expand Down

0 comments on commit 0764fd2

Please sign in to comment.