Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

trivial: MPT fusion - remove long dead code

This triggers false bug reports as it does a bogus kmalloc with locks held
but is never really compiled into the kernel.

Closes #8329

Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Alan Cox and committed by
Linus Torvalds
54e7ff9d 8638545c

-108
-108
drivers/message/fusion/mptlan.c
··· 77 77 * Fusion MPT LAN private structures 78 78 */ 79 79 80 - struct NAA_Hosed { 81 - u16 NAA; 82 - u8 ieee[FC_ALEN]; 83 - struct NAA_Hosed *next; 84 - }; 85 - 86 80 struct BufferControl { 87 81 struct sk_buff *skb; 88 82 dma_addr_t dma; ··· 152 158 153 159 static u32 max_buckets_out = 127; 154 160 static u32 tx_max_out_p = 127 - 16; 155 - 156 - #ifdef QLOGIC_NAA_WORKAROUND 157 - static struct NAA_Hosed *mpt_bad_naa = NULL; 158 - DEFINE_RWLOCK(bad_naa_lock); 159 - #endif 160 161 161 162 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ 162 163 /** ··· 769 780 // ctx, skb, skb->data)); 770 781 771 782 mac = skb_mac_header(skb); 772 - #ifdef QLOGIC_NAA_WORKAROUND 773 - { 774 - struct NAA_Hosed *nh; 775 - 776 - /* Munge the NAA for Tx packets to QLogic boards, which don't follow 777 - RFC 2625. The longer I look at this, the more my opinion of Qlogic 778 - drops. */ 779 - read_lock_irq(&bad_naa_lock); 780 - for (nh = mpt_bad_naa; nh != NULL; nh=nh->next) { 781 - if ((nh->ieee[0] == mac[0]) && 782 - (nh->ieee[1] == mac[1]) && 783 - (nh->ieee[2] == mac[2]) && 784 - (nh->ieee[3] == mac[3]) && 785 - (nh->ieee[4] == mac[4]) && 786 - (nh->ieee[5] == mac[5])) { 787 - cur_naa = nh->NAA; 788 - dlprintk ((KERN_INFO "mptlan/sdu_send: using NAA value " 789 - "= %04x.\n", cur_naa)); 790 - break; 791 - } 792 - } 793 - read_unlock_irq(&bad_naa_lock); 794 - } 795 - #endif 796 783 797 784 pTrans->TransactionDetails[0] = cpu_to_le32((cur_naa << 16) | 798 785 (mac[0] << 8) | ··· 1537 1572 1538 1573 fcllc = (struct fcllc *)skb->data; 1539 1574 1540 - #ifdef QLOGIC_NAA_WORKAROUND 1541 - { 1542 - u16 source_naa = fch->stype, found = 0; 1543 - 1544 - /* Workaround for QLogic not following RFC 2625 in regards to the NAA 1545 - value. */ 1546 - 1547 - if ((source_naa & 0xF000) == 0) 1548 - source_naa = swab16(source_naa); 1549 - 1550 - if (fcllc->ethertype == htons(ETH_P_ARP)) 1551 - dlprintk ((KERN_INFO "mptlan/type_trans: got arp req/rep w/ naa of " 1552 - "%04x.\n", source_naa)); 1553 - 1554 - if ((fcllc->ethertype == htons(ETH_P_ARP)) && 1555 - ((source_naa >> 12) != MPT_LAN_NAA_RFC2625)){ 1556 - struct NAA_Hosed *nh, *prevnh; 1557 - int i; 1558 - 1559 - dlprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep from " 1560 - "system with non-RFC 2625 NAA value (%04x).\n", 1561 - source_naa)); 1562 - 1563 - write_lock_irq(&bad_naa_lock); 1564 - for (prevnh = nh = mpt_bad_naa; nh != NULL; 1565 - prevnh=nh, nh=nh->next) { 1566 - if ((nh->ieee[0] == fch->saddr[0]) && 1567 - (nh->ieee[1] == fch->saddr[1]) && 1568 - (nh->ieee[2] == fch->saddr[2]) && 1569 - (nh->ieee[3] == fch->saddr[3]) && 1570 - (nh->ieee[4] == fch->saddr[4]) && 1571 - (nh->ieee[5] == fch->saddr[5])) { 1572 - found = 1; 1573 - dlprintk ((KERN_INFO "mptlan/type_trans: ARP Re" 1574 - "q/Rep w/ bad NAA from system already" 1575 - " in DB.\n")); 1576 - break; 1577 - } 1578 - } 1579 - 1580 - if ((!found) && (nh == NULL)) { 1581 - 1582 - nh = kmalloc(sizeof(struct NAA_Hosed), GFP_KERNEL); 1583 - dlprintk ((KERN_INFO "mptlan/type_trans: ARP Req/Rep w/" 1584 - " bad NAA from system not yet in DB.\n")); 1585 - 1586 - if (nh != NULL) { 1587 - nh->next = NULL; 1588 - if (!mpt_bad_naa) 1589 - mpt_bad_naa = nh; 1590 - if (prevnh) 1591 - prevnh->next = nh; 1592 - 1593 - nh->NAA = source_naa; /* Set the S_NAA value. */ 1594 - for (i = 0; i < FC_ALEN; i++) 1595 - nh->ieee[i] = fch->saddr[i]; 1596 - dlprintk ((KERN_INFO "Got ARP from %02x:%02x:%02x:%02x:" 1597 - "%02x:%02x with non-compliant S_NAA value.\n", 1598 - fch->saddr[0], fch->saddr[1], fch->saddr[2], 1599 - fch->saddr[3], fch->saddr[4],fch->saddr[5])); 1600 - } else { 1601 - printk (KERN_ERR "mptlan/type_trans: Unable to" 1602 - " kmalloc a NAA_Hosed struct.\n"); 1603 - } 1604 - } else if (!found) { 1605 - printk (KERN_ERR "mptlan/type_trans: found not" 1606 - " set, but nh isn't null. Evil " 1607 - "funkiness abounds.\n"); 1608 - } 1609 - write_unlock_irq(&bad_naa_lock); 1610 - } 1611 - } 1612 - #endif 1613 1575 1614 1576 /* Strip the SNAP header from ARP packets since we don't 1615 1577 * pass them through to the 802.2/SNAP layers.