Skip to content

Commit

Permalink
drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c: adjust array index
Browse files Browse the repository at this point in the history
Convert array index from the loop bound to the loop index.

A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression e1,e2,ar;
@@

for(e1 = 0; e1 < e2; e1++) { <...
  ar[
- e2
+ e1
  ]
  ...> }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Julia Lawall authored and Greg Kroah-Hartman committed Aug 2, 2011
1 parent e72be3f commit 193634c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsparser.c
Original file line number Diff line number Diff line change
@@ -812,7 +812,7 @@ int AthCreateCommandList(struct ps_cmd_packet **HciPacketList, u32 *numPackets)
for(count = 0; count < Patch_Count; count++) {

AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("Freeing Patch Buffer %d \r\n",count));
kfree(RamPatch[Patch_Count].Data);
kfree(RamPatch[count].Data);
}

for(count = 0; count < Tag_Count; count++) {

0 comments on commit 193634c

Please sign in to comment.