diff options
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_cq.c | 5 | ||||
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_irq.c | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 20 |
3 files changed, 26 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/infiniband/hw/ehca/ehca_cq.c index 93995b658d94..6074c897f51c 100644 --- a/drivers/infiniband/hw/ehca/ehca_cq.c +++ b/drivers/infiniband/hw/ehca/ehca_cq.c | |||
@@ -344,8 +344,11 @@ int ehca_destroy_cq(struct ib_cq *cq) | |||
344 | unsigned long flags; | 344 | unsigned long flags; |
345 | 345 | ||
346 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | 346 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); |
347 | while (my_cq->nr_callbacks) | 347 | while (my_cq->nr_callbacks) { |
348 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | ||
348 | yield(); | 349 | yield(); |
350 | spin_lock_irqsave(&ehca_cq_idr_lock, flags); | ||
351 | } | ||
349 | 352 | ||
350 | idr_remove(&ehca_cq_idr, my_cq->token); | 353 | idr_remove(&ehca_cq_idr, my_cq->token); |
351 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); | 354 | spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); |
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c index e7209afb4250..c069be8cbcb2 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/infiniband/hw/ehca/ehca_irq.c | |||
@@ -440,7 +440,8 @@ void ehca_tasklet_eq(unsigned long data) | |||
440 | cq = idr_find(&ehca_cq_idr, token); | 440 | cq = idr_find(&ehca_cq_idr, token); |
441 | 441 | ||
442 | if (cq == NULL) { | 442 | if (cq == NULL) { |
443 | spin_unlock(&ehca_cq_idr_lock); | 443 | spin_unlock_irqrestore(&ehca_cq_idr_lock, |
444 | flags); | ||
444 | break; | 445 | break; |
445 | } | 446 | } |
446 | 447 | ||
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index cdecbf5911c8..72611fd15103 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1621,18 +1621,30 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1621 | switch (token) { | 1621 | switch (token) { |
1622 | case SRP_OPT_ID_EXT: | 1622 | case SRP_OPT_ID_EXT: |
1623 | p = match_strdup(args); | 1623 | p = match_strdup(args); |
1624 | if (!p) { | ||
1625 | ret = -ENOMEM; | ||
1626 | goto out; | ||
1627 | } | ||
1624 | target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1628 | target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1625 | kfree(p); | 1629 | kfree(p); |
1626 | break; | 1630 | break; |
1627 | 1631 | ||
1628 | case SRP_OPT_IOC_GUID: | 1632 | case SRP_OPT_IOC_GUID: |
1629 | p = match_strdup(args); | 1633 | p = match_strdup(args); |
1634 | if (!p) { | ||
1635 | ret = -ENOMEM; | ||
1636 | goto out; | ||
1637 | } | ||
1630 | target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1638 | target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1631 | kfree(p); | 1639 | kfree(p); |
1632 | break; | 1640 | break; |
1633 | 1641 | ||
1634 | case SRP_OPT_DGID: | 1642 | case SRP_OPT_DGID: |
1635 | p = match_strdup(args); | 1643 | p = match_strdup(args); |
1644 | if (!p) { | ||
1645 | ret = -ENOMEM; | ||
1646 | goto out; | ||
1647 | } | ||
1636 | if (strlen(p) != 32) { | 1648 | if (strlen(p) != 32) { |
1637 | printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); | 1649 | printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); |
1638 | kfree(p); | 1650 | kfree(p); |
@@ -1656,6 +1668,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1656 | 1668 | ||
1657 | case SRP_OPT_SERVICE_ID: | 1669 | case SRP_OPT_SERVICE_ID: |
1658 | p = match_strdup(args); | 1670 | p = match_strdup(args); |
1671 | if (!p) { | ||
1672 | ret = -ENOMEM; | ||
1673 | goto out; | ||
1674 | } | ||
1659 | target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1675 | target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1660 | kfree(p); | 1676 | kfree(p); |
1661 | break; | 1677 | break; |
@@ -1693,6 +1709,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) | |||
1693 | 1709 | ||
1694 | case SRP_OPT_INITIATOR_EXT: | 1710 | case SRP_OPT_INITIATOR_EXT: |
1695 | p = match_strdup(args); | 1711 | p = match_strdup(args); |
1712 | if (!p) { | ||
1713 | ret = -ENOMEM; | ||
1714 | goto out; | ||
1715 | } | ||
1696 | target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); | 1716 | target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); |
1697 | kfree(p); | 1717 | kfree(p); |
1698 | break; | 1718 | break; |