summaryrefslogtreecommitdiff
path: root/arch/mips/sgi-ip22
diff options
context:
space:
mode:
authorLevente Kurusa <levex@linux.com>2013-12-19 16:03:27 +0100
committerRalf Baechle <ralf@linux-mips.org>2014-07-30 13:27:51 +0200
commit82242d28ff8bd2b3e0230190529c1ff333c766e1 (patch)
tree332b799835dcdd66aff9c6b5010fa3c842f09981 /arch/mips/sgi-ip22
parentf0a7a2d042807d08e5bcfd3194e74b16810c4def (diff)
downloadlwn-82242d28ff8bd2b3e0230190529c1ff333c766e1.tar.gz
lwn-82242d28ff8bd2b3e0230190529c1ff333c766e1.zip
MIPS: IP22: Add missing put_device call
This is required so that we give up the last reference to the device. Also, create a gio_bus_release() that calls kfree on the device argument to properly kfree() the memory allocated for the device. [ralf@linux-mips.org: Reformat to Linux coding style and make gio_bus_release static.] Signed-off-by: Levente Kurusa <levex@linux.com> Cc: LKML <linux-kernel@vger.kernel.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6261/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/sgi-ip22')
-rw-r--r--arch/mips/sgi-ip22/ip22-gio.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c
index 8e52446286ca..8f1b86d4da84 100644
--- a/arch/mips/sgi-ip22/ip22-gio.c
+++ b/arch/mips/sgi-ip22/ip22-gio.c
@@ -27,8 +27,14 @@ static struct {
{ .name = "SGI GR2/GR3", .id = 0x7f },
};
+static void gio_bus_release(struct device *dev)
+{
+ kfree(dev);
+}
+
static struct device gio_bus = {
.init_name = "gio",
+ .release = &gio_bus_release,
};
/**
@@ -413,8 +419,10 @@ int __init ip22_gio_init(void)
int ret;
ret = device_register(&gio_bus);
- if (ret)
+ if (ret) {
+ put_device(&gio_bus);
return ret;
+ }
ret = bus_register(&gio_bus_type);
if (!ret) {