mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 01:34:14 +08:00
linux-can-fixes-for-4.12-20170609
-----BEGIN PGP SIGNATURE----- iQFHBAABCgAxFiEE4bay/IylYqM/npjQHv7KIOw4HPYFAlk6mLwTHG1rbEBwZW5n dXRyb25peC5kZQAKCRAe/sog7Dgc9vx5CADTRLfMxgmmGsLcM8nO0sKn/7X/o4Hy qprZy1Nu4J49kG/93pumIvWkcG9fzZ4hbDy+4DiEmL/fIumbvg56aaW90fyvW9Cl HzL3S7Id8Db6Qwfr4Wd7r1IRYn08+om4ukO09GdskmMpS4wOr68+3WhutGGu1mEX ZS2sTE/dKnozZqUw6agcwXJmAJWFbYBaVcF+x2GT07ako0jYXF29zqe/GlpmzVBJ Wmib9DO2BeDm/QpNIot/I3Se86xS0AIH6ds++YRJX6k9dlFb4T2Liw6UysPSVCz6 QkAT3SiTu3TKoT1TXEyMQEQSpnrFtpMowdTk/s04bKibVIpTTskZm44c =DNKW -----END PGP SIGNATURE----- Merge tag 'linux-can-fixes-for-4.12-20170609' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can Marc Kleine-Budde says: ==================== pull-request: can 2017-06-09 this is a pull request of 6 patches for net/master. There's a patch by Stephane Grosjean that fixes an uninitialized symbol warning in the peak_canfd driver. A patch by Johan Hovold to fix the product-id endianness in an error message in the the peak_usb driver. A patch by Oliver Hartkopp to enable CAN FD for virtual CAN devices by default. Three patches by me, one makes the helper function can_change_state() robust to be called with cf == NULL. The next patch fixes a memory leak in the gs_usb driver. And the last one fixes a lockdep splat by properly initialize the per-net can_rcvlists_lock spin_lock. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
f6d4c71332
@ -391,6 +391,9 @@ void can_change_state(struct net_device *dev, struct can_frame *cf,
|
||||
can_update_state_error_stats(dev, new_state);
|
||||
priv->state = new_state;
|
||||
|
||||
if (!cf)
|
||||
return;
|
||||
|
||||
if (unlikely(new_state == CAN_STATE_BUS_OFF)) {
|
||||
cf->can_id |= CAN_ERR_BUSOFF;
|
||||
return;
|
||||
|
@ -489,7 +489,7 @@ int peak_canfd_handle_msgs_list(struct peak_canfd_priv *priv,
|
||||
struct pucan_rx_msg *msg_list, int msg_count)
|
||||
{
|
||||
void *msg_ptr = msg_list;
|
||||
int i, msg_size;
|
||||
int i, msg_size = 0;
|
||||
|
||||
for (i = 0; i < msg_count; i++) {
|
||||
msg_size = peak_canfd_handle_msg(priv, msg_ptr);
|
||||
|
@ -265,6 +265,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev)
|
||||
sizeof(*dm),
|
||||
1000);
|
||||
|
||||
kfree(dm);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -908,8 +908,6 @@ static int peak_usb_probe(struct usb_interface *intf,
|
||||
const struct peak_usb_adapter *peak_usb_adapter = NULL;
|
||||
int i, err = -ENOMEM;
|
||||
|
||||
usb_dev = interface_to_usbdev(intf);
|
||||
|
||||
/* get corresponding PCAN-USB adapter */
|
||||
for (i = 0; i < ARRAY_SIZE(peak_usb_adapters_list); i++)
|
||||
if (peak_usb_adapters_list[i]->device_id == usb_id_product) {
|
||||
@ -920,7 +918,7 @@ static int peak_usb_probe(struct usb_interface *intf,
|
||||
if (!peak_usb_adapter) {
|
||||
/* should never come except device_id bad usage in this file */
|
||||
pr_err("%s: didn't find device id. 0x%x in devices list\n",
|
||||
PCAN_USB_DRIVER_NAME, usb_dev->descriptor.idProduct);
|
||||
PCAN_USB_DRIVER_NAME, usb_id_product);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
@ -152,7 +152,7 @@ static const struct net_device_ops vcan_netdev_ops = {
|
||||
static void vcan_setup(struct net_device *dev)
|
||||
{
|
||||
dev->type = ARPHRD_CAN;
|
||||
dev->mtu = CAN_MTU;
|
||||
dev->mtu = CANFD_MTU;
|
||||
dev->hard_header_len = 0;
|
||||
dev->addr_len = 0;
|
||||
dev->tx_queue_len = 0;
|
||||
|
@ -150,7 +150,7 @@ static const struct net_device_ops vxcan_netdev_ops = {
|
||||
static void vxcan_setup(struct net_device *dev)
|
||||
{
|
||||
dev->type = ARPHRD_CAN;
|
||||
dev->mtu = CAN_MTU;
|
||||
dev->mtu = CANFD_MTU;
|
||||
dev->hard_header_len = 0;
|
||||
dev->addr_len = 0;
|
||||
dev->tx_queue_len = 0;
|
||||
|
@ -872,8 +872,7 @@ static int can_notifier(struct notifier_block *nb, unsigned long msg,
|
||||
|
||||
static int can_pernet_init(struct net *net)
|
||||
{
|
||||
net->can.can_rcvlists_lock =
|
||||
__SPIN_LOCK_UNLOCKED(net->can.can_rcvlists_lock);
|
||||
spin_lock_init(&net->can.can_rcvlists_lock);
|
||||
net->can.can_rx_alldev_list =
|
||||
kzalloc(sizeof(struct dev_rcv_lists), GFP_KERNEL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user