diff options
-rw-r--r-- | drivers/block/rbd.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index c34f8716d1d2..e728e11096b4 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -138,13 +138,13 @@ struct rbd_image_header { | |||
138 | */ | 138 | */ |
139 | struct rbd_spec { | 139 | struct rbd_spec { |
140 | u64 pool_id; | 140 | u64 pool_id; |
141 | char *pool_name; | 141 | const char *pool_name; |
142 | 142 | ||
143 | char *image_id; | 143 | const char *image_id; |
144 | char *image_name; | 144 | const char *image_name; |
145 | 145 | ||
146 | u64 snap_id; | 146 | u64 snap_id; |
147 | char *snap_name; | 147 | const char *snap_name; |
148 | 148 | ||
149 | struct kref kref; | 149 | struct kref kref; |
150 | }; | 150 | }; |
@@ -4375,6 +4375,7 @@ static int rbd_add_parse_args(const char *buf, | |||
4375 | size_t len; | 4375 | size_t len; |
4376 | char *options; | 4376 | char *options; |
4377 | const char *mon_addrs; | 4377 | const char *mon_addrs; |
4378 | char *snap_name; | ||
4378 | size_t mon_addrs_size; | 4379 | size_t mon_addrs_size; |
4379 | struct rbd_spec *spec = NULL; | 4380 | struct rbd_spec *spec = NULL; |
4380 | struct rbd_options *rbd_opts = NULL; | 4381 | struct rbd_options *rbd_opts = NULL; |
@@ -4433,10 +4434,11 @@ static int rbd_add_parse_args(const char *buf, | |||
4433 | ret = -ENAMETOOLONG; | 4434 | ret = -ENAMETOOLONG; |
4434 | goto out_err; | 4435 | goto out_err; |
4435 | } | 4436 | } |
4436 | spec->snap_name = kmemdup(buf, len + 1, GFP_KERNEL); | 4437 | snap_name = kmemdup(buf, len + 1, GFP_KERNEL); |
4437 | if (!spec->snap_name) | 4438 | if (!snap_name) |
4438 | goto out_mem; | 4439 | goto out_mem; |
4439 | *(spec->snap_name + len) = '\0'; | 4440 | *(snap_name + len) = '\0'; |
4441 | spec->snap_name = snap_name; | ||
4440 | 4442 | ||
4441 | /* Initialize all rbd options to the defaults */ | 4443 | /* Initialize all rbd options to the defaults */ |
4442 | 4444 | ||