Merge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband:
IB/ehca: Fix mismatched spin_unlock in irq handler
IB/ehca: Fix improper use of yield() with spinlock held
IB/srp: Check match_strdup() return

+26 -2
+4 -1
drivers/infiniband/hw/ehca/ehca_cq.c
··· 344 unsigned long flags; 345 346 spin_lock_irqsave(&ehca_cq_idr_lock, flags); 347 - while (my_cq->nr_callbacks) 348 yield(); 349 350 idr_remove(&ehca_cq_idr, my_cq->token); 351 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
··· 344 unsigned long flags; 345 346 spin_lock_irqsave(&ehca_cq_idr_lock, flags); 347 + while (my_cq->nr_callbacks) { 348 + spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); 349 yield(); 350 + spin_lock_irqsave(&ehca_cq_idr_lock, flags); 351 + } 352 353 idr_remove(&ehca_cq_idr, my_cq->token); 354 spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
+2 -1
drivers/infiniband/hw/ehca/ehca_irq.c
··· 440 cq = idr_find(&ehca_cq_idr, token); 441 442 if (cq == NULL) { 443 - spin_unlock(&ehca_cq_idr_lock); 444 break; 445 } 446
··· 440 cq = idr_find(&ehca_cq_idr, token); 441 442 if (cq == NULL) { 443 + spin_unlock_irqrestore(&ehca_cq_idr_lock, 444 + flags); 445 break; 446 } 447
+20
drivers/infiniband/ulp/srp/ib_srp.c
··· 1621 switch (token) { 1622 case SRP_OPT_ID_EXT: 1623 p = match_strdup(args); 1624 target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1625 kfree(p); 1626 break; 1627 1628 case SRP_OPT_IOC_GUID: 1629 p = match_strdup(args); 1630 target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1631 kfree(p); 1632 break; 1633 1634 case SRP_OPT_DGID: 1635 p = match_strdup(args); 1636 if (strlen(p) != 32) { 1637 printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); 1638 kfree(p); ··· 1668 1669 case SRP_OPT_SERVICE_ID: 1670 p = match_strdup(args); 1671 target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1672 kfree(p); 1673 break; ··· 1709 1710 case SRP_OPT_INITIATOR_EXT: 1711 p = match_strdup(args); 1712 target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1713 kfree(p); 1714 break;
··· 1621 switch (token) { 1622 case SRP_OPT_ID_EXT: 1623 p = match_strdup(args); 1624 + if (!p) { 1625 + ret = -ENOMEM; 1626 + goto out; 1627 + } 1628 target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1629 kfree(p); 1630 break; 1631 1632 case SRP_OPT_IOC_GUID: 1633 p = match_strdup(args); 1634 + if (!p) { 1635 + ret = -ENOMEM; 1636 + goto out; 1637 + } 1638 target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1639 kfree(p); 1640 break; 1641 1642 case SRP_OPT_DGID: 1643 p = match_strdup(args); 1644 + if (!p) { 1645 + ret = -ENOMEM; 1646 + goto out; 1647 + } 1648 if (strlen(p) != 32) { 1649 printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); 1650 kfree(p); ··· 1656 1657 case SRP_OPT_SERVICE_ID: 1658 p = match_strdup(args); 1659 + if (!p) { 1660 + ret = -ENOMEM; 1661 + goto out; 1662 + } 1663 target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1664 kfree(p); 1665 break; ··· 1693 1694 case SRP_OPT_INITIATOR_EXT: 1695 p = match_strdup(args); 1696 + if (!p) { 1697 + ret = -ENOMEM; 1698 + goto out; 1699 + } 1700 target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); 1701 kfree(p); 1702 break;