Commit 821836e5 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 73f66ace cea9ea67
...@@ -344,8 +344,11 @@ int ehca_destroy_cq(struct ib_cq *cq) ...@@ -344,8 +344,11 @@ int ehca_destroy_cq(struct ib_cq *cq)
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&ehca_cq_idr_lock, flags); spin_lock_irqsave(&ehca_cq_idr_lock, flags);
while (my_cq->nr_callbacks) while (my_cq->nr_callbacks) {
spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
yield(); yield();
spin_lock_irqsave(&ehca_cq_idr_lock, flags);
}
idr_remove(&ehca_cq_idr, my_cq->token); idr_remove(&ehca_cq_idr, my_cq->token);
spin_unlock_irqrestore(&ehca_cq_idr_lock, flags); spin_unlock_irqrestore(&ehca_cq_idr_lock, flags);
......
...@@ -440,7 +440,8 @@ void ehca_tasklet_eq(unsigned long data) ...@@ -440,7 +440,8 @@ void ehca_tasklet_eq(unsigned long data)
cq = idr_find(&ehca_cq_idr, token); cq = idr_find(&ehca_cq_idr, token);
if (cq == NULL) { if (cq == NULL) {
spin_unlock(&ehca_cq_idr_lock); spin_unlock_irqrestore(&ehca_cq_idr_lock,
flags);
break; break;
} }
......
...@@ -1621,18 +1621,30 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) ...@@ -1621,18 +1621,30 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
switch (token) { switch (token) {
case SRP_OPT_ID_EXT: case SRP_OPT_ID_EXT:
p = match_strdup(args); p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); target->id_ext = cpu_to_be64(simple_strtoull(p, NULL, 16));
kfree(p); kfree(p);
break; break;
case SRP_OPT_IOC_GUID: case SRP_OPT_IOC_GUID:
p = match_strdup(args); p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16)); target->ioc_guid = cpu_to_be64(simple_strtoull(p, NULL, 16));
kfree(p); kfree(p);
break; break;
case SRP_OPT_DGID: case SRP_OPT_DGID:
p = match_strdup(args); p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
if (strlen(p) != 32) { if (strlen(p) != 32) {
printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p); printk(KERN_WARNING PFX "bad dest GID parameter '%s'\n", p);
kfree(p); kfree(p);
...@@ -1656,6 +1668,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) ...@@ -1656,6 +1668,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
case SRP_OPT_SERVICE_ID: case SRP_OPT_SERVICE_ID:
p = match_strdup(args); p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16)); target->service_id = cpu_to_be64(simple_strtoull(p, NULL, 16));
kfree(p); kfree(p);
break; break;
...@@ -1693,6 +1709,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target) ...@@ -1693,6 +1709,10 @@ static int srp_parse_options(const char *buf, struct srp_target_port *target)
case SRP_OPT_INITIATOR_EXT: case SRP_OPT_INITIATOR_EXT:
p = match_strdup(args); p = match_strdup(args);
if (!p) {
ret = -ENOMEM;
goto out;
}
target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16)); target->initiator_ext = cpu_to_be64(simple_strtoull(p, NULL, 16));
kfree(p); kfree(p);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment