Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 710708e8 authored by Julia Lawall's avatar Julia Lawall Committed by David S. Miller
Browse files

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: default avatarJulia Lawall <julia@diku.dk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 671c8806
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -557,7 +557,7 @@ static int ia_cbr_setup (IADEV *dev, struct atm_vcc *vcc) {
          memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC));
          memcpy((caddr_t)&cbrVC,(caddr_t)TstSchedTbl,sizeof(cbrVC));
       } /* while */
       } /* while */
       // Move this VCI number into this location of the CBR Sched table.
       // Move this VCI number into this location of the CBR Sched table.
       memcpy((caddr_t)TstSchedTbl, (caddr_t)&vcIndex,sizeof(TstSchedTbl));
       memcpy((caddr_t)TstSchedTbl, (caddr_t)&vcIndex, sizeof(*TstSchedTbl));
       dev->CbrRemEntries--;
       dev->CbrRemEntries--;
       toBeAssigned--;
       toBeAssigned--;
   } /* while */ 
   } /* while */