Skip to content

Commit

Permalink
can: mcp251x: fix generation of error frames
Browse files Browse the repository at this point in the history
The function "mcp251x_error_skb" is used to generate error frames.
They are identified by the "CAN_ERR_FLAG" in can_id. The function
overwrites the can_id so that the frames show up as normal frames instead
of error frames.

This patch fixes the problem by or'ing the can_id instead of overwriting it.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Tested-by: Jargalan Nermunkh <jargalan.nermunkh@criticallink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marc Kleine-Budde authored and David S. Miller committed Oct 21, 2010
1 parent 5601b2d commit 612eef4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/can/mcp251x.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ static void mcp251x_error_skb(struct net_device *net, int can_id, int data1)

skb = alloc_can_err_skb(net, &frame);
if (skb) {
frame->can_id = can_id;
frame->can_id |= can_id;
frame->data[1] = data1;
netif_rx_ni(skb);
} else {
Expand Down

0 comments on commit 612eef4

Please sign in to comment.