summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev/axonram.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-03-16 09:50:50 +0100
committerIngo Molnar <mingo@kernel.org>2017-03-16 09:50:50 +0100
commit2b95bd7d58d368fe5dcbe6f4e494847ea082d89d (patch)
tree48c38d792f31f2fe10b26b03bdf1b10a82ca03a4 /arch/powerpc/sysdev/axonram.c
parentMerge tag 'perf-core-for-mingo-4.12-20170314' of git://git.kernel.org/pub/scm... (diff)
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-block (diff)
downloadlinux-2b95bd7d58d368fe5dcbe6f4e494847ea082d89d.tar.xz
linux-2b95bd7d58d368fe5dcbe6f4e494847ea082d89d.zip
Merge branch 'linus' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/powerpc/sysdev/axonram.c')
-rw-r--r--arch/powerpc/sysdev/axonram.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c
index ada29eaed6e2..f523ac883150 100644
--- a/arch/powerpc/sysdev/axonram.c
+++ b/arch/powerpc/sysdev/axonram.c
@@ -274,7 +274,9 @@ failed:
if (bank->disk->major > 0)
unregister_blkdev(bank->disk->major,
bank->disk->disk_name);
- del_gendisk(bank->disk);
+ if (bank->disk->flags & GENHD_FL_UP)
+ del_gendisk(bank->disk);
+ put_disk(bank->disk);
}
device->dev.platform_data = NULL;
if (bank->io_addr != 0)
@@ -299,6 +301,7 @@ axon_ram_remove(struct platform_device *device)
device_remove_file(&device->dev, &dev_attr_ecc);
free_irq(bank->irq_id, device);
del_gendisk(bank->disk);
+ put_disk(bank->disk);
iounmap((void __iomem *) bank->io_addr);
kfree(bank);