Skip to content

Commit 3e6e867

Browse files
committed
Merge tag 'linux-can-fixes-for-4.15-20180104' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== pull-request: can 2018-01-04 this is a pull request for net/master consisting of 4 patches. The first patch is by Oliver Hartkopp, it improves the error checking during the creation of a vxcan link. Wolfgang Grandegger's patch for the gs_usb driver fixes the return value of the "set_bittiming" callback. Luu An Phu provides a patch for the flexcan driver to fix the frame length check in the flexcan_start_xmit() function. The last patch is by Martin Lederhilger for the ems_usb driver and improves the error reporting for error warning and passive frames. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents d1616f0 + 6ebc5e8 commit 3e6e867

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

drivers/net/can/flexcan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
526526
data = be32_to_cpup((__be32 *)&cf->data[0]);
527527
flexcan_write(data, &priv->tx_mb->data[0]);
528528
}
529-
if (cf->can_dlc > 3) {
529+
if (cf->can_dlc > 4) {
530530
data = be32_to_cpup((__be32 *)&cf->data[4]);
531531
flexcan_write(data, &priv->tx_mb->data[1]);
532532
}

drivers/net/can/usb/ems_usb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
395395

396396
if (dev->can.state == CAN_STATE_ERROR_WARNING ||
397397
dev->can.state == CAN_STATE_ERROR_PASSIVE) {
398+
cf->can_id |= CAN_ERR_CRTL;
398399
cf->data[1] = (txerr > rxerr) ?
399400
CAN_ERR_CRTL_TX_PASSIVE : CAN_ERR_CRTL_RX_PASSIVE;
400401
}

drivers/net/can/usb/gs_usb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ static int gs_usb_set_bittiming(struct net_device *netdev)
449449
dev_err(netdev->dev.parent, "Couldn't set bittimings (err=%d)",
450450
rc);
451451

452-
return rc;
452+
return (rc > 0) ? 0 : rc;
453453
}
454454

455455
static void gs_usb_xmit_callback(struct urb *urb)

drivers/net/can/vxcan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static int vxcan_newlink(struct net *net, struct net_device *dev,
194194
tbp = peer_tb;
195195
}
196196

197-
if (tbp[IFLA_IFNAME]) {
197+
if (ifmp && tbp[IFLA_IFNAME]) {
198198
nla_strlcpy(ifname, tbp[IFLA_IFNAME], IFNAMSIZ);
199199
name_assign_type = NET_NAME_USER;
200200
} else {

0 commit comments

Comments
 (0)