| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * QLogic QLA3xxx NIC HBA Driver |
|---|
| 3 | 4 | * Copyright (c) 2003-2006 QLogic Corporation |
|---|
| 4 | | - * |
|---|
| 5 | | - * See LICENSE.qla3xxx for copyright and licensing details. |
|---|
| 6 | 5 | */ |
|---|
| 7 | 6 | |
|---|
| 8 | 7 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
|---|
| .. | .. |
|---|
| 1542 | 1541 | if (test_bit(QL_LINK_MASTER, &qdev->flags)) |
|---|
| 1543 | 1542 | ql_port_start(qdev); |
|---|
| 1544 | 1543 | qdev->port_link_state = LS_DOWN; |
|---|
| 1545 | | - /* Fall Through */ |
|---|
| 1544 | + fallthrough; |
|---|
| 1546 | 1545 | |
|---|
| 1547 | 1546 | case LS_DOWN: |
|---|
| 1548 | 1547 | if (curr_link_state == LS_UP) { |
|---|
| .. | .. |
|---|
| 1858 | 1857 | wmb(); |
|---|
| 1859 | 1858 | writel_relaxed(qdev->small_buf_q_producer_index, |
|---|
| 1860 | 1859 | &port_regs->CommonRegs.rxSmallQProducerIndex); |
|---|
| 1861 | | - mmiowb(); |
|---|
| 1862 | 1860 | } |
|---|
| 1863 | 1861 | } |
|---|
| 1864 | 1862 | |
|---|
| .. | .. |
|---|
| 2477 | 2475 | skb_shinfo(skb)->nr_frags); |
|---|
| 2478 | 2476 | if (tx_cb->seg_count == -1) { |
|---|
| 2479 | 2477 | netdev_err(ndev, "%s: invalid segment count!\n", __func__); |
|---|
| 2478 | + dev_kfree_skb_any(skb); |
|---|
| 2480 | 2479 | return NETDEV_TX_OK; |
|---|
| 2481 | 2480 | } |
|---|
| 2482 | 2481 | |
|---|
| .. | .. |
|---|
| 3602 | 3601 | return 0; |
|---|
| 3603 | 3602 | } |
|---|
| 3604 | 3603 | |
|---|
| 3605 | | -static void ql3xxx_tx_timeout(struct net_device *ndev) |
|---|
| 3604 | +static void ql3xxx_tx_timeout(struct net_device *ndev, unsigned int txqueue) |
|---|
| 3606 | 3605 | { |
|---|
| 3607 | 3606 | struct ql3_adapter *qdev = netdev_priv(ndev); |
|---|
| 3608 | 3607 | |
|---|
| .. | .. |
|---|
| 3630 | 3629 | qdev->mem_map_registers; |
|---|
| 3631 | 3630 | unsigned long hw_flags; |
|---|
| 3632 | 3631 | |
|---|
| 3633 | | - if (test_bit((QL_RESET_PER_SCSI | QL_RESET_START), &qdev->flags)) { |
|---|
| 3632 | + if (test_bit(QL_RESET_PER_SCSI, &qdev->flags) || |
|---|
| 3633 | + test_bit(QL_RESET_START, &qdev->flags)) { |
|---|
| 3634 | 3634 | clear_bit(QL_LINK_MASTER, &qdev->flags); |
|---|
| 3635 | 3635 | |
|---|
| 3636 | 3636 | /* |
|---|
| .. | .. |
|---|
| 3769 | 3769 | struct net_device *ndev = NULL; |
|---|
| 3770 | 3770 | struct ql3_adapter *qdev = NULL; |
|---|
| 3771 | 3771 | static int cards_found; |
|---|
| 3772 | | - int uninitialized_var(pci_using_dac), err; |
|---|
| 3772 | + int pci_using_dac, err; |
|---|
| 3773 | 3773 | |
|---|
| 3774 | 3774 | err = pci_enable_device(pdev); |
|---|
| 3775 | 3775 | if (err) { |
|---|
| .. | .. |
|---|
| 3886 | 3886 | netif_stop_queue(ndev); |
|---|
| 3887 | 3887 | |
|---|
| 3888 | 3888 | qdev->workqueue = create_singlethread_workqueue(ndev->name); |
|---|
| 3889 | + if (!qdev->workqueue) { |
|---|
| 3890 | + unregister_netdev(ndev); |
|---|
| 3891 | + err = -ENOMEM; |
|---|
| 3892 | + goto err_out_iounmap; |
|---|
| 3893 | + } |
|---|
| 3894 | + |
|---|
| 3889 | 3895 | INIT_DELAYED_WORK(&qdev->reset_work, ql_reset_work); |
|---|
| 3890 | 3896 | INIT_DELAYED_WORK(&qdev->tx_timeout_work, ql_tx_timeout_work); |
|---|
| 3891 | 3897 | INIT_DELAYED_WORK(&qdev->link_state_work, ql_link_state_machine_work); |
|---|