diff options
Diffstat (limited to 'drivers/block/swim3.c')
-rw-r--r-- | drivers/block/swim3.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c index 965af0a3e95b..4b91c9aa5892 100644 --- a/drivers/block/swim3.c +++ b/drivers/block/swim3.c @@ -27,6 +27,7 @@ #include <linux/module.h> #include <linux/spinlock.h> #include <linux/wait.h> +#include <linux/major.h> #include <asm/io.h> #include <asm/dbdma.h> #include <asm/prom.h> @@ -1229,7 +1230,9 @@ static int swim3_attach(struct macio_dev *mdev, disk->flags |= GENHD_FL_REMOVABLE; sprintf(disk->disk_name, "fd%d", floppy_count); set_capacity(disk, 2880); - add_disk(disk); + rc = add_disk(disk); + if (rc) + goto out_cleanup_disk; disks[floppy_count++] = disk; return 0; |