Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208534
b: refs/heads/master
c: 7faefea
h: refs/heads/master
v: v3
  • Loading branch information
Yinghai Lu authored and Linus Torvalds committed Aug 11, 2010
1 parent 4aa4cec commit 5da8051
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f46c77c283e514a747aee7e8c4f5afc70274c232
refs/heads/master: 7faefea66a6d1f0d9da0a18615f57dc969e00d99
35 changes: 28 additions & 7 deletions trunk/drivers/char/ipmi/ipmi_si_intf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1804,9 +1804,12 @@ static int hotmod_handler(const char *val, struct kernel_param *kp)
info->irq_setup = std_irq_setup;
info->slave_addr = ipmb;

if (!add_smi(info))
if (!add_smi(info)) {
if (try_smi_init(info))
cleanup_one_si(info);
} else {
kfree(info);
}
} else {
/* remove */
struct smi_info *e, *tmp_e;
Expand Down Expand Up @@ -1890,9 +1893,12 @@ static __devinit void hardcode_find_bmc(void)
info->irq_setup = std_irq_setup;
info->slave_addr = slave_addrs[i];

if (!add_smi(info))
if (!add_smi(info)) {
if (try_smi_init(info))
cleanup_one_si(info);
} else {
kfree(info);
}
}
}

Expand Down Expand Up @@ -2082,7 +2088,8 @@ static __devinit int try_init_spmi(struct SPMITable *spmi)
}
info->io.addr_data = spmi->addr.address;

add_smi(info);
if (add_smi(info))
kfree(info);

return 0;
}
Expand Down Expand Up @@ -2198,7 +2205,10 @@ static int __devinit ipmi_pnp_probe(struct pnp_dev *dev,
res, info->io.regsize, info->io.regspacing,
info->irq);

return add_smi(info);
if (add_smi(info))
goto err_free;

return 0;

err_free:
kfree(info);
Expand Down Expand Up @@ -2356,7 +2366,8 @@ static __devinit void try_init_dmi(struct dmi_ipmi_data *ipmi_data)
if (info->irq)
info->irq_setup = std_irq_setup;

add_smi(info);
if (add_smi(info))
kfree(info);
}

static void __devinit dmi_find_bmc(void)
Expand Down Expand Up @@ -2462,7 +2473,10 @@ static int __devinit ipmi_pci_probe(struct pci_dev *pdev,
&pdev->resource[0], info->io.regsize, info->io.regspacing,
info->irq);

return add_smi(info);
if (add_smi(info))
kfree(info);

return 0;
}

static void __devexit ipmi_pci_remove(struct pci_dev *pdev)
Expand Down Expand Up @@ -2575,7 +2589,12 @@ static int __devinit ipmi_of_probe(struct of_device *dev,

dev_set_drvdata(&dev->dev, info);

return add_smi(info);
if (add_smi(info)) {
kfree(info);
return -EBUSY;
}

return 0;
}

static int __devexit ipmi_of_remove(struct of_device *dev)
Expand Down Expand Up @@ -3008,6 +3027,8 @@ static __devinit void default_find_bmc(void)
info->io.addr_data);
} else
cleanup_one_si(info);
} else {
kfree(info);
}
}
}
Expand Down

0 comments on commit 5da8051

Please sign in to comment.