Commit f4bb93a8 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge tag 'linux-can-fixes-for-5.16-20220109' of...

Merge tag 'linux-can-fixes-for-5.16-20220109' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2022-01-09

The first patch is by Johan Hovold and fixes a mem leak in the error
path of the softing_cs driver.

The next patch is by me and fixes a set but not used variable warning
in the softing driver.

Jiasheng Jiang's patch for the xilinx_can driver adds the missing
error checking when getting the IRQ.

Lad Prabhakar contributes a patch for the rcar_canfd driver to fix a
mem leak in the error path.

The last patch is by Brian Silverman and properly initializes the send
USB messages to avoid spurious CAN error frames.

* tag 'linux-can-fixes-for-5.16-20220109' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
  can: gs_usb: gs_can_start_xmit(): zero-initialize hf->{flags,reserved}
  can: rcar_canfd: rcar_canfd_channel_probe(): make sure we free CAN network device
  can: xilinx_can: xcan_probe(): check for error irq
  can: softing: softing_startstop(): fix set but not used variable warning
  can: softing_cs: softingcs_probe(): fix memleak on registration failure
====================

Link: https://lore.kernel.org/r/20220109134040.1945428-1-mkl@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 6dc9a23e 89d58aeb
...@@ -1640,8 +1640,7 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch, ...@@ -1640,8 +1640,7 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
ndev = alloc_candev(sizeof(*priv), RCANFD_FIFO_DEPTH); ndev = alloc_candev(sizeof(*priv), RCANFD_FIFO_DEPTH);
if (!ndev) { if (!ndev) {
dev_err(&pdev->dev, "alloc_candev() failed\n"); dev_err(&pdev->dev, "alloc_candev() failed\n");
err = -ENOMEM; return -ENOMEM;
goto fail;
} }
priv = netdev_priv(ndev); priv = netdev_priv(ndev);
...@@ -1735,8 +1734,8 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch, ...@@ -1735,8 +1734,8 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
fail_candev: fail_candev:
netif_napi_del(&priv->napi); netif_napi_del(&priv->napi);
free_candev(ndev);
fail: fail:
free_candev(ndev);
return err; return err;
} }
......
...@@ -293,7 +293,7 @@ static int softingcs_probe(struct pcmcia_device *pcmcia) ...@@ -293,7 +293,7 @@ static int softingcs_probe(struct pcmcia_device *pcmcia)
return 0; return 0;
platform_failed: platform_failed:
kfree(dev); platform_device_put(pdev);
mem_failed: mem_failed:
pcmcia_bad: pcmcia_bad:
pcmcia_failed: pcmcia_failed:
......
...@@ -565,18 +565,19 @@ int softing_startstop(struct net_device *dev, int up) ...@@ -565,18 +565,19 @@ int softing_startstop(struct net_device *dev, int up)
if (ret < 0) if (ret < 0)
goto failed; goto failed;
} }
/* enable_error_frame */
/* /* enable_error_frame
*
* Error reporting is switched off at the moment since * Error reporting is switched off at the moment since
* the receiving of them is not yet 100% verified * the receiving of them is not yet 100% verified
* This should be enabled sooner or later * This should be enabled sooner or later
* */
if (error_reporting) { if (0 && error_reporting) {
ret = softing_fct_cmd(card, 51, "enable_error_frame"); ret = softing_fct_cmd(card, 51, "enable_error_frame");
if (ret < 0) if (ret < 0)
goto failed; goto failed;
} }
*/
/* initialize interface */ /* initialize interface */
iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 2]); iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 2]);
iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 4]); iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 4]);
......
...@@ -508,6 +508,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb, ...@@ -508,6 +508,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb,
hf->echo_id = idx; hf->echo_id = idx;
hf->channel = dev->channel; hf->channel = dev->channel;
hf->flags = 0;
hf->reserved = 0;
cf = (struct can_frame *)skb->data; cf = (struct can_frame *)skb->data;
......
...@@ -1761,7 +1761,12 @@ static int xcan_probe(struct platform_device *pdev) ...@@ -1761,7 +1761,12 @@ static int xcan_probe(struct platform_device *pdev)
spin_lock_init(&priv->tx_lock); spin_lock_init(&priv->tx_lock);
/* Get IRQ for the device */ /* Get IRQ for the device */
ndev->irq = platform_get_irq(pdev, 0); ret = platform_get_irq(pdev, 0);
if (ret < 0)
goto err_free;
ndev->irq = ret;
ndev->flags |= IFF_ECHO; /* We support local echo */ ndev->flags |= IFF_ECHO; /* We support local echo */
platform_set_drvdata(pdev, ndev); platform_set_drvdata(pdev, ndev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment