From: Andreas Gruenbacher Date: Tue, 24 May 2011 12:17:08 +0000 (+0200) Subject: drbd: drbd_adm_prepare(): Pass through error codes X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1e2a2551ee8fbbac082eb4c14af1289e7aa880f0;p=linux-beck.git drbd: drbd_adm_prepare(): Pass through error codes Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- 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, return -EPERM; adm_ctx.reply_skb = genlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); - if (!adm_ctx.reply_skb) + if (!adm_ctx.reply_skb) { + err = -ENOMEM; goto fail; + } adm_ctx.reply_dh = genlmsg_put_reply(adm_ctx.reply_skb, info, &drbd_genl_family, 0, cmd); /* put of a few bytes into a fresh skb of >= 4k will always succeed. * but anyways */ - if (!adm_ctx.reply_dh) + if (!adm_ctx.reply_dh) { + err = -ENOMEM; goto fail; + } adm_ctx.reply_dh->minor = d_in->minor; 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, fail: nlmsg_free(adm_ctx.reply_skb); adm_ctx.reply_skb = NULL; - return -ENOMEM; + return err; } static int drbd_adm_finish(struct genl_info *info, int retcode)