aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_nl.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-05-24 08:17:08 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-08 10:55:56 -0500
commit1e2a2551ee8fbbac082eb4c14af1289e7aa880f0 (patch)
treed056f0c661ac2c2781ba295c8d9d6be06d90275a /drivers/block/drbd/drbd_nl.c
parent5084d71d89e1a94193378efb12ac659e4e6ada3f (diff)
drbd: drbd_adm_prepare(): Pass through error codes
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_nl.c')
-rw-r--r--drivers/block/drbd/drbd_nl.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index b81f924c47bc..c9ecb7b04c1f 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -156,15 +156,19 @@ static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info,
156 return -EPERM; 156 return -EPERM;
157 157
158 adm_ctx.reply_skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); 158 adm_ctx.reply_skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL);
159 if (!adm_ctx.reply_skb) 159 if (!adm_ctx.reply_skb) {
160 err = -ENOMEM;
160 goto fail; 161 goto fail;
162 }
161 163
162 adm_ctx.reply_dh = genlmsg_put_reply(adm_ctx.reply_skb, 164 adm_ctx.reply_dh = genlmsg_put_reply(adm_ctx.reply_skb,
163 info, &drbd_genl_family, 0, cmd); 165 info, &drbd_genl_family, 0, cmd);
164 /* put of a few bytes into a fresh skb of >= 4k will always succeed. 166 /* put of a few bytes into a fresh skb of >= 4k will always succeed.
165 * but anyways */ 167 * but anyways */
166 if (!adm_ctx.reply_dh) 168 if (!adm_ctx.reply_dh) {
169 err = -ENOMEM;
167 goto fail; 170 goto fail;
171 }
168 172
169 adm_ctx.reply_dh->minor = d_in->minor; 173 adm_ctx.reply_dh->minor = d_in->minor;
170 adm_ctx.reply_dh->ret_code = NO_ERROR; 174 adm_ctx.reply_dh->ret_code = NO_ERROR;
@@ -229,7 +233,7 @@ static int drbd_adm_prepare(struct sk_buff *skb, struct genl_info *info,
229fail: 233fail:
230 nlmsg_free(adm_ctx.reply_skb); 234 nlmsg_free(adm_ctx.reply_skb);
231 adm_ctx.reply_skb = NULL; 235 adm_ctx.reply_skb = NULL;
232 return -ENOMEM; 236 return err;
233} 237}
234 238
235static int drbd_adm_finish(struct genl_info *info, int retcode) 239static int drbd_adm_finish(struct genl_info *info, int retcode)