include: drivers: can: Fix zframe to frame conversion
can_copy_zframe_to_frame did not distinguish between the standard and extended frames. As a result, uninitialized bits were copied to the destination frame. This commit changes the function to use the correct bitfields. Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit is contained in:
parent
8c2b849ae7
commit
30ebf52a27
1 changed files with 2 additions and 1 deletions
|
@ -616,7 +616,8 @@ static inline void can_copy_zframe_to_frame(const struct zcan_frame *zframe,
|
|||
struct can_frame *frame)
|
||||
{
|
||||
frame->can_id = (zframe->id_type << 31) | (zframe->rtr << 30) |
|
||||
zframe->ext_id;
|
||||
(zframe->id_type == CAN_STANDARD_IDENTIFIER ? zframe->std_id :
|
||||
zframe->ext_id);
|
||||
frame->can_dlc = zframe->dlc;
|
||||
memcpy(frame->data, zframe->data, sizeof(frame->data));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue