aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoedev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/aoe/aoedev.c')
-rw-r--r--drivers/block/aoe/aoedev.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c
index 784c92e038d1..e774c50b6842 100644
--- a/drivers/block/aoe/aoedev.c
+++ b/drivers/block/aoe/aoedev.c
@@ -12,6 +12,7 @@
12#include <linux/bitmap.h> 12#include <linux/bitmap.h>
13#include <linux/kdev_t.h> 13#include <linux/kdev_t.h>
14#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
15#include <linux/string.h>
15#include "aoe.h" 16#include "aoe.h"
16 17
17static void dummy_timer(ulong); 18static void dummy_timer(ulong);
@@ -241,16 +242,12 @@ aoedev_downdev(struct aoedev *d)
241static int 242static int
242user_req(char *s, size_t slen, struct aoedev *d) 243user_req(char *s, size_t slen, struct aoedev *d)
243{ 244{
244 char *p; 245 const char *p;
245 size_t lim; 246 size_t lim;
246 247
247 if (!d->gd) 248 if (!d->gd)
248 return 0; 249 return 0;
249 p = strrchr(d->gd->disk_name, '/'); 250 p = kbasename(d->gd->disk_name);
250 if (!p)
251 p = d->gd->disk_name;
252 else
253 p += 1;
254 lim = sizeof(d->gd->disk_name); 251 lim = sizeof(d->gd->disk_name);
255 lim -= p - d->gd->disk_name; 252 lim -= p - d->gd->disk_name;
256 if (slen < lim) 253 if (slen < lim)
@@ -278,6 +275,7 @@ freedev(struct aoedev *d)
278 275
279 del_timer_sync(&d->timer); 276 del_timer_sync(&d->timer);
280 if (d->gd) { 277 if (d->gd) {
278 aoedisk_rm_debugfs(d);
281 aoedisk_rm_sysfs(d); 279 aoedisk_rm_sysfs(d);
282 del_gendisk(d->gd); 280 del_gendisk(d->gd);
283 put_disk(d->gd); 281 put_disk(d->gd);