···10181018 out_id = zl3073x_output_pin_out_get(pin->id);10191019 out = zl3073x_out_state_get(zldev, out_id);1020102010211021- /* Convert value to ps and reverse two's complement negation applied10221022- * during 'set'10231023- */10241024- *phase_adjust = -out->phase_comp * pin->phase_gran;10211021+ /* The value in the register is expressed in half synth clock cycles. */10221022+ *phase_adjust = out->phase_comp * pin->phase_gran;1025102310261024 return 0;10271025}···10411043 out_id = zl3073x_output_pin_out_get(pin->id);10421044 out = *zl3073x_out_state_get(zldev, out_id);1043104510441044- /* The value in the register is stored as two's complement negation10451045- * of requested value and expressed in half synth clock cycles.10461046- */10471047- out.phase_comp = -phase_adjust / pin->phase_gran;10461046+ /* The value in the register is expressed in half synth clock cycles. */10471047+ out.phase_comp = phase_adjust / pin->phase_gran;1048104810491049 /* Update output configuration from mailbox */10501050 return zl3073x_out_state_set(zldev, out_id, &out);
···165165 select CRC32166166 select PHYLIB167167 select AMD_XGBE_HAVE_ECC if X86168168- select NET_SELFTESTS168168+ imply NET_SELFTESTS169169 help170170 This driver supports the AMD 10GbE Ethernet device found on an171171 AMD SoC.
+5-6
drivers/net/ethernet/cadence/macb_main.c
···705705 if (rx_pause)706706 ctrl |= MACB_BIT(PAE);707707708708- /* Initialize rings & buffers as clearing MACB_BIT(TE) in link down709709- * cleared the pipeline and control registers.710710- */711711- macb_init_buffers(bp);712712-713713- for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)708708+ for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {709709+ queue->tx_head = 0;710710+ queue->tx_tail = 0;714711 queue_writel(queue, IER,715712 bp->rx_intr_mask | MACB_TX_INT_FLAGS | MACB_BIT(HRESP));713713+ }716714 }717715718716 macb_or_gem_writel(bp, NCFGR, ctrl);···29522954 }2953295529542956 bp->macbgem_ops.mog_init_rings(bp);29572957+ macb_init_buffers(bp);2955295829562959 for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {29572960 napi_enable(&queue->napi_rx);
+9-2
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
···10491049 int order;1050105010511051 if (!alloc_size)10521052- return;10521052+ goto not_init;1053105310541054 order = get_order(alloc_size);10551055 if (order > MAX_PAGE_ORDER) {10561056 if (net_ratelimit())10571057 dev_warn(ring_to_dev(ring), "failed to allocate tx spare buffer, exceed to max order\n");10581058- return;10581058+ goto not_init;10591059 }1060106010611061 tx_spare = devm_kzalloc(ring_to_dev(ring), sizeof(*tx_spare),···10931093 devm_kfree(ring_to_dev(ring), tx_spare);10941094devm_kzalloc_error:10951095 ring->tqp->handle->kinfo.tx_spare_buf_size = 0;10961096+not_init:10971097+ /* When driver init or reset_init, the ring->tx_spare is always NULL;10981098+ * but when called from hns3_set_ringparam, it's usually not NULL, and10991099+ * will be restored if hns3_init_all_ring() failed. So it's safe to set11001100+ * ring->tx_spare to NULL here.11011101+ */11021102+ ring->tx_spare = NULL;10961103}1097110410981105/* Use hns3_tx_spare_space() to make sure there is enough buffer
···9191 /* Get bus_id, this can be overwritten later */9292 plat->bus_id = pci_dev_id(pdev);93939494- /* clk_csr_i = 20-35MHz & MDC = clk_csr_i/16 */9595- plat->clk_csr = STMMAC_CSR_20_35M;9494+ /* clk_csr_i = 100-150MHz & MDC = clk_csr_i/62 */9595+ plat->clk_csr = STMMAC_CSR_100_150M;9696 plat->core_type = DWMAC_CORE_GMAC;9797 plat->force_sf_dma_mode = 1;9898
+3
drivers/net/ethernet/sun/sunhme.c
···25512551 goto err_out_clear_quattro;25522552 }2553255325542554+ /* BIGMAC may have bogus sizes */25552555+ if ((op->resource[3].end - op->resource[3].start) >= BMAC_REG_SIZE)25562556+ op->resource[3].end = op->resource[3].start + BMAC_REG_SIZE - 1;25542557 hp->bigmacregs = devm_platform_ioremap_resource(op, 3);25552558 if (IS_ERR(hp->bigmacregs)) {25562559 dev_err(&op->dev, "Cannot map BIGMAC registers.\n");
+1
drivers/net/ethernet/ti/Kconfig
···192192 depends on NET_SWITCHDEV193193 depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER194194 depends on PTP_1588_CLOCK_OPTIONAL195195+ depends on HSR || !HSR195196 help196197 Support dual Gigabit Ethernet ports over the ICSSG PRU Subsystem.197198 This subsystem is available starting with the AM65 platform.
+6-9
drivers/net/ethernet/ti/cpsw_new.c
···1472147214731473 for (i = 0; i < cpsw->data.slaves; i++) {14741474 ndev = cpsw->slaves[i].ndev;14751475- if (!ndev)14751475+ if (!ndev || ndev->reg_state != NETREG_REGISTERED)14761476 continue;1477147714781478 priv = netdev_priv(ndev);···14941494 if (ret) {14951495 dev_err(cpsw->dev,14961496 "cpsw: err registering net device%d\n", i);14971497- cpsw->slaves[i].ndev = NULL;14981497 break;14991498 }15001499 }···20022003 /* setup netdevs */20032004 ret = cpsw_create_ports(cpsw);20042005 if (ret)20052005- goto clean_unregister_netdev;20062006+ goto clean_cpts;2006200720072008 /* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and20082009 * MISC IRQs which are always kept disabled with this driver so···20162017 0, dev_name(dev), cpsw);20172018 if (ret < 0) {20182019 dev_err(dev, "error attaching irq (%d)\n", ret);20192019- goto clean_unregister_netdev;20202020+ goto clean_cpts;20202021 }2021202220222023 ret = devm_request_irq(dev, cpsw->irqs_table[1], cpsw_tx_interrupt,20232024 0, dev_name(dev), cpsw);20242025 if (ret < 0) {20252026 dev_err(dev, "error attaching irq (%d)\n", ret);20262026- goto clean_unregister_netdev;20272027+ goto clean_cpts;20272028 }2028202920292030 if (!cpsw->cpts)···20332034 0, dev_name(&pdev->dev), cpsw);20342035 if (ret < 0) {20352036 dev_err(dev, "error attaching misc irq (%d)\n", ret);20362036- goto clean_unregister_netdev;20372037+ goto clean_cpts;20372038 }2038203920392040 /* Enable misc CPTS evnt_pend IRQ */···20422043skip_cpts:20432044 ret = cpsw_register_notifiers(cpsw);20442045 if (ret)20452045- goto clean_unregister_netdev;20462046+ goto clean_cpts;2046204720472048 ret = cpsw_register_devlink(cpsw);20482049 if (ret)···2064206520652066clean_unregister_notifiers:20662067 cpsw_unregister_notifiers(cpsw);20672067-clean_unregister_netdev:20682068- cpsw_unregister_ports(cpsw);20692068clean_cpts:20702069 cpts_release(cpsw->cpts);20712070 cpdma_ctlr_destroy(cpsw->dma);
···1111#define MPTCP_PM_VER 112121313/**1414- * enum mptcp_event_type1414+ * enum mptcp_event_type - Netlink MPTCP event types1515 * @MPTCP_EVENT_UNSPEC: unused event1616 * @MPTCP_EVENT_CREATED: A new MPTCP connection has been created. It is the1717 * good time to allocate memory and send ADD_ADDR if needed. Depending on the
+54-2
net/atm/signaling.c
···22222323struct atm_vcc *sigd = NULL;24242525+/*2626+ * find_get_vcc - validate and get a reference to a vcc pointer2727+ * @vcc: the vcc pointer to validate2828+ *2929+ * This function validates that @vcc points to a registered VCC in vcc_hash.3030+ * If found, it increments the socket reference count and returns the vcc.3131+ * The caller must call sock_put(sk_atm(vcc)) when done.3232+ *3333+ * Returns the vcc pointer if valid, NULL otherwise.3434+ */3535+static struct atm_vcc *find_get_vcc(struct atm_vcc *vcc)3636+{3737+ int i;3838+3939+ read_lock(&vcc_sklist_lock);4040+ for (i = 0; i < VCC_HTABLE_SIZE; i++) {4141+ struct sock *s;4242+4343+ sk_for_each(s, &vcc_hash[i]) {4444+ if (atm_sk(s) == vcc) {4545+ sock_hold(s);4646+ read_unlock(&vcc_sklist_lock);4747+ return vcc;4848+ }4949+ }5050+ }5151+ read_unlock(&vcc_sklist_lock);5252+ return NULL;5353+}5454+2555static void sigd_put_skb(struct sk_buff *skb)2656{2757 if (!sigd) {···996910070 msg = (struct atmsvc_msg *) skb->data;10171 WARN_ON(refcount_sub_and_test(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc));102102- vcc = *(struct atm_vcc **) &msg->vcc;7272+7373+ vcc = find_get_vcc(*(struct atm_vcc **)&msg->vcc);7474+ if (!vcc) {7575+ pr_debug("invalid vcc pointer in msg\n");7676+ dev_kfree_skb(skb);7777+ return -EINVAL;7878+ }7979+10380 pr_debug("%d (0x%lx)\n", (int)msg->type, (unsigned long)vcc);10481 sk = sk_atm(vcc);10582···137100 clear_bit(ATM_VF_WAITING, &vcc->flags);138101 break;139102 case as_indicate:140140- vcc = *(struct atm_vcc **)&msg->listen_vcc;103103+ /* Release the reference from msg->vcc, we'll use msg->listen_vcc instead */104104+ sock_put(sk);105105+106106+ vcc = find_get_vcc(*(struct atm_vcc **)&msg->listen_vcc);107107+ if (!vcc) {108108+ pr_debug("invalid listen_vcc pointer in msg\n");109109+ dev_kfree_skb(skb);110110+ return -EINVAL;111111+ }112112+141113 sk = sk_atm(vcc);142114 pr_debug("as_indicate!!!\n");143115 lock_sock(sk);···161115 sk->sk_state_change(sk);162116as_indicate_complete:163117 release_sock(sk);118118+ /* Paired with find_get_vcc(msg->listen_vcc) above */119119+ sock_put(sk);164120 return 0;165121 case as_close:166122 set_bit(ATM_VF_RELEASED, &vcc->flags);···179131 break;180132 default:181133 pr_alert("bad message type %d\n", (int)msg->type);134134+ /* Paired with find_get_vcc(msg->vcc) above */135135+ sock_put(sk);182136 return -EINVAL;183137 }184138 sk->sk_state_change(sk);185139out:186140 dev_kfree_skb(skb);141141+ /* Paired with find_get_vcc(msg->vcc) above */142142+ sock_put(sk);187143 return 0;188144}189145
+25-4
net/ipv4/icmp.c
···559559 /* steal dst entry from skb_in, don't drop refcnt */560560 skb_dstref_steal(skb_in);561561 skb_dstref_restore(skb_in, orefdst);562562+563563+ /*564564+ * At this point, fl4_dec.daddr should NOT be local (we565565+ * checked fl4_dec.saddr above). However, a race condition566566+ * may occur if the address is added to the interface567567+ * concurrently. In that case, ip_route_input() returns a568568+ * LOCAL route with dst.output=ip_rt_bug, which must not569569+ * be used for output.570570+ */571571+ if (!err && rt2 && rt2->rt_type == RTN_LOCAL) {572572+ net_warn_ratelimited("detected local route for %pI4 during ICMP sending, src %pI4\n",573573+ &fl4_dec.daddr, &fl4_dec.saddr);574574+ dst_release(&rt2->dst);575575+ err = -EINVAL;576576+ }562577 }563578564579 if (err)···10521037 /* Checkin full IP header plus 8 bytes of protocol to10531038 * avoid additional coding at protocol handlers.10541039 */10551055- if (!pskb_may_pull(skb, iph->ihl * 4 + 8)) {10561056- __ICMP_INC_STATS(dev_net_rcu(skb->dev), ICMP_MIB_INERRORS);10571057- return;10581058- }10401040+ if (!pskb_may_pull(skb, iph->ihl * 4 + 8))10411041+ goto out;10421042+10431043+ /* IPPROTO_RAW sockets are not supposed to receive anything. */10441044+ if (protocol == IPPROTO_RAW)10451045+ goto out;1059104610601047 raw_icmp_error(skb, protocol, info);1061104810621049 ipprot = rcu_dereference(inet_protos[protocol]);10631050 if (ipprot && ipprot->err_handler)10641051 ipprot->err_handler(skb, info);10521052+ return;10531053+10541054+out:10551055+ __ICMP_INC_STATS(dev_net_rcu(skb->dev), ICMP_MIB_INERRORS);10651056}1066105710671058static bool icmp_tag_validation(int proto)
+6
net/ipv6/icmp.c
···10671067 if (reason != SKB_NOT_DROPPED_YET)10681068 goto out;1069106910701070+ if (nexthdr == IPPROTO_RAW) {10711071+ /* Add a more specific reason later ? */10721072+ reason = SKB_DROP_REASON_NOT_SPECIFIED;10731073+ goto out;10741074+ }10751075+10701076 /* BUGGG_FUTURE: we should try to parse exthdrs in this packet.10711077 Without this we will not able f.e. to make source routed10721078 pmtu discovery.
+12-17
net/mptcp/pm_kernel.c
···10441044 return ret;10451045}1046104610471047-static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,10471047+static void mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,10481048 const struct mptcp_addr_info *addr,10491049 bool force)10501050{10511051 struct mptcp_rm_list list = { .nr = 0 };10521052- bool ret;10521052+ bool announced;1053105310541054 list.ids[list.nr++] = mptcp_endp_get_local_id(msk, addr);1055105510561056- ret = mptcp_remove_anno_list_by_saddr(msk, addr);10571057- if (ret || force) {10561056+ announced = mptcp_remove_anno_list_by_saddr(msk, addr);10571057+ if (announced || force) {10581058 spin_lock_bh(&msk->pm.lock);10591059- if (ret) {10601060- __set_bit(addr->id, msk->pm.id_avail_bitmap);10591059+ if (announced)10611060 msk->pm.add_addr_signaled--;10621062- }10631061 mptcp_pm_remove_addr(msk, &list);10641062 spin_unlock_bh(&msk->pm.lock);10651063 }10661066- return ret;10671064}1068106510691066static void __mark_subflow_endp_available(struct mptcp_sock *msk, u8 id)···10941097 !(entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT));1095109810961099 list.ids[0] = mptcp_endp_get_local_id(msk, addr);10971097- if (remove_subflow) {10981098- spin_lock_bh(&msk->pm.lock);10991099- mptcp_pm_rm_subflow(msk, &list);11001100- spin_unlock_bh(&msk->pm.lock);11011101- }1102110011031103- if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) {11041104- spin_lock_bh(&msk->pm.lock);11011101+ spin_lock_bh(&msk->pm.lock);11021102+ if (remove_subflow)11031103+ mptcp_pm_rm_subflow(msk, &list);11041104+ if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW)11051105 __mark_subflow_endp_available(msk, list.ids[0]);11061106- spin_unlock_bh(&msk->pm.lock);11071107- }11061106+ else /* mark endp ID as available, e.g. Signal or MPC endp */11071107+ __set_bit(addr->id, msk->pm.id_avail_bitmap);11081108+ spin_unlock_bh(&msk->pm.lock);1108110911091110 if (msk->mpc_endpoint_id == entry->addr.id)11101111 msk->mpc_endpoint_id = 0;
+9-7
net/mptcp/token.c
···103103 * It creates a unique token to identify the new mptcp connection,104104 * a secret local key and the initial data sequence number (idsn).105105 *106106- * Returns 0 on success.106106+ * Return: 0 on success.107107 */108108int mptcp_token_new_request(struct request_sock *req)109109{···146146 * the computed token at a later time, this is needed to process147147 * join requests.148148 *149149- * returns 0 on success.149149+ * Return: 0 on success.150150 */151151int mptcp_token_new_connect(struct sock *ssk)152152{···241241 * This function returns the mptcp connection structure with the given token.242242 * A reference count on the mptcp socket returned is taken.243243 *244244- * returns NULL if no connection with the given token value exists.244244+ * Return: NULL if no connection with the given token value exists.245245 */246246struct mptcp_sock *mptcp_token_get_sock(struct net *net, u32 token)247247{···288288 * @s_slot: start slot number289289 * @s_num: start number inside the given lock290290 *291291- * This function returns the first mptcp connection structure found inside the292292- * token container starting from the specified position, or NULL.291291+ * Description:292292+ * On successful iteration, the iterator is moved to the next position and a293293+ * reference to the returned socket is acquired.293294 *294294- * On successful iteration, the iterator is moved to the next position and295295- * a reference to the returned socket is acquired.295295+ * Return:296296+ * The first mptcp connection structure found inside the token container297297+ * starting from the specified position, or NULL.296298 */297299struct mptcp_sock *mptcp_token_iter_next(const struct net *net, long *s_slot,298300 long *s_num)
···1650165016511651 timeo = sock_sndtimeo(sk, flags & O_NONBLOCK);1652165216531653- /* First of all allocate resources.16541654- * If we will make it after state is locked,16551655- * we will have to recheck all again in any case.16561656- */16531653+ err = prepare_peercred(&peercred);16541654+ if (err)16551655+ goto out;1657165616581657 /* create new sock for complete connection */16591658 newsk = unix_create1(net, NULL, 0, sock->type);···16601661 err = PTR_ERR(newsk);16611662 goto out;16621663 }16631663-16641664- err = prepare_peercred(&peercred);16651665- if (err)16661666- goto out;1667166416681665 /* Allocate skb for sending to listening sock */16691666 skb = sock_wmalloc(newsk, 1, 0, GFP_KERNEL);