Skip to content

Commit 710708e

Browse files
Julia Lawalldavem330
authored andcommitted
drivers/atm: Correct code taking the size of a pointer
sizeof(TstSchedTbl) is just the size of the pointer. Change it to the size of the referenced data. A simplified version of the semantic patch that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression *x; expression f; type T; @@ *f(...,(T)x,...) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 671c880 commit 710708e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/atm/iphase.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) {
557557
memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC));
558558
} /* while */
559559
// Move this VCI number into this location of the CBR Sched table.
560-
memcpy((caddr_t)TstSchedTbl, (caddr_t)&vcIndex,sizeof(TstSchedTbl));
560+
memcpy((caddr_t)TstSchedTbl, (caddr_t)&vcIndex, sizeof(*TstSchedTbl));
561561
dev->CbrRemEntries--;
562562
toBeAssigned--;
563563
} /* while */

0 commit comments

Comments
 (0)