Commit 2376cca0 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull staging driver fixes from Greg KH:
 "Here are some small staging driver fixes for issues that have been
  reported in 5.10-rc1:

   - octeon driver fixes

   - wfx driver fixes

   - memory leak fix in vchiq driver

   - fieldbus driver bugfix

   - comedi driver bugfix

  All of these have been in linux-next with no reported issues"

* tag 'staging-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: fieldbus: anybuss: jump to correct label in an error path
  staging: wfx: fix test on return value of gpiod_get_value()
  staging: wfx: fix use of uninitialized pointer
  staging: mmal-vchiq: Fix memory leak for vchiq_instance
  staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
  staging: octeon: Drop on uncorrectable alignment or FCS error
  staging: octeon: repair "fixed-link" support
parents 2754a42e 7e97e4cb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1342,6 +1342,7 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
		if (dev->irq && board->has_ao_fifo) {
			dev->write_subdev = s;
			s->subdev_flags	|= SDF_CMD_WRITE;
			s->len_chanlist	= s->n_chan;
			s->do_cmdtest	= cb_pcidas_ao_cmdtest;
			s->do_cmd	= cb_pcidas_ao_cmd;
			s->cancel	= cb_pcidas_ao_cancel;
+1 −1
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ static int controller_probe(struct platform_device *pdev)
	regulator = devm_regulator_register(dev, &can_power_desc, &config);
	if (IS_ERR(regulator)) {
		err = PTR_ERR(regulator);
		goto out_reset;
		goto out_ida;
	}
	/* make controller info visible to userspace */
	cd->class_dev = kzalloc(sizeof(*cd->class_dev), GFP_KERNEL);
+0 −6
Original line number Diff line number Diff line
@@ -147,12 +147,6 @@ int cvm_oct_phy_setup_device(struct net_device *dev)

	phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0);
	if (!phy_node && of_phy_is_fixed_link(priv->of_node)) {
		int rc;

		rc = of_phy_register_fixed_link(priv->of_node);
		if (rc)
			return rc;

		phy_node = of_node_get(priv->of_node);
	}
	if (!phy_node)
+19 −15
Original line number Diff line number Diff line
@@ -69,14 +69,16 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
	else
		port = work->word1.cn38xx.ipprt;

	if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64)) {
	if ((work->word2.snoip.err_code == 10) && (work->word1.len <= 64))
		/*
		 * Ignore length errors on min size packets. Some
		 * equipment incorrectly pads packets to 64+4FCS
		 * instead of 60+4FCS.  Note these packets still get
		 * counted as frame errors.
		 */
	} else if (work->word2.snoip.err_code == 5 ||
		return 0;

	if (work->word2.snoip.err_code == 5 ||
	    work->word2.snoip.err_code == 7) {
		/*
		 * We received a packet with either an alignment error
@@ -108,7 +110,10 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
				/* Port received 0xd5 preamble */
				work->packet_ptr.s.addr += i + 1;
				work->word1.len -= i + 5;
			} else if ((*ptr & 0xf) == 0xd) {
				return 0;
			}

			if ((*ptr & 0xf) == 0xd) {
				/* Port received 0xd preamble */
				work->packet_ptr.s.addr += i;
				work->word1.len -= i + 4;
@@ -118,23 +123,22 @@ static inline int cvm_oct_check_rcv_error(struct cvmx_wqe *work)
					    ((*(ptr + 1) & 0xf) << 4);
					ptr++;
				}
			} else {
				return 0;
			}

			printk_ratelimited("Port %d unknown preamble, packet dropped\n",
					   port);
			cvm_oct_free_work(work);
			return 1;
		}
	}
	} else {

	printk_ratelimited("Port %d receive error code %d, packet dropped\n",
			   port, work->word2.snoip.err_code);
	cvm_oct_free_work(work);
	return 1;
}

	return 0;
}

static void copy_segments_to_skb(struct cvmx_wqe *work, struct sk_buff *skb)
{
	int segments = work->word2.s.bufs;
+9 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/phy.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
@@ -892,6 +893,14 @@ static int cvm_oct_probe(struct platform_device *pdev)
				break;
			}

			if (priv->of_node && of_phy_is_fixed_link(priv->of_node)) {
				if (of_phy_register_fixed_link(priv->of_node)) {
					netdev_err(dev, "Failed to register fixed link for interface %d, port %d\n",
						   interface, priv->port);
					dev->netdev_ops = NULL;
				}
			}

			if (!dev->netdev_ops) {
				free_netdev(dev);
			} else if (register_netdev(dev) < 0) {
Loading