Commit f4bb93a8 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 6dc9a23e 89d58aeb
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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);
	if (!ndev) {
		dev_err(&pdev->dev, "alloc_candev() failed\n");
		err = -ENOMEM;
		goto fail;
		return -ENOMEM;
	}
	priv = netdev_priv(ndev);

@@ -1735,8 +1734,8 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,

fail_candev:
	netif_napi_del(&priv->napi);
	free_candev(ndev);
fail:
	free_candev(ndev);
	return err;
}

+1 −1
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ static int softingcs_probe(struct pcmcia_device *pcmcia)
	return 0;

platform_failed:
	kfree(dev);
	platform_device_put(pdev);
mem_failed:
pcmcia_bad:
pcmcia_failed:
+6 −5
Original line number Diff line number Diff line
@@ -565,18 +565,19 @@ int softing_startstop(struct net_device *dev, int up)
		if (ret < 0)
			goto failed;
	}
	/* enable_error_frame */
	/*

	/* enable_error_frame
	 *
	 * Error reporting is switched off at the moment since
	 * the receiving of them is not yet 100% verified
	 * This should be enabled sooner or later
	 *
	if (error_reporting) {
	 */
	if (0 && error_reporting) {
		ret = softing_fct_cmd(card, 51, "enable_error_frame");
		if (ret < 0)
			goto failed;
	}
	*/

	/* initialize interface */
	iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 2]);
	iowrite16(1, &card->dpram[DPRAM_FCT_PARAM + 4]);
+2 −0
Original line number Diff line number Diff line
@@ -508,6 +508,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb,

	hf->echo_id = idx;
	hf->channel = dev->channel;
	hf->flags = 0;
	hf->reserved = 0;

	cf = (struct can_frame *)skb->data;

+6 −1
Original line number Diff line number Diff line
@@ -1761,7 +1761,12 @@ static int xcan_probe(struct platform_device *pdev)
	spin_lock_init(&priv->tx_lock);

	/* 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 */

	platform_set_drvdata(pdev, ndev);