Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 346077
b: refs/heads/master
c: 1e2a255
h: refs/heads/master
i:
  346075: 5ba56f7
v: v3
  • Loading branch information
Andreas Gruenbacher authored and Philipp Reisner committed Nov 8, 2012
1 parent 93243d5 commit 8fe2a14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5084d71d89e1a94193378efb12ac659e4e6ada3f
refs/heads/master: 1e2a2551ee8fbbac082eb4c14af1289e7aa880f0
10 changes: 7 additions & 3 deletions trunk/drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 8fe2a14

Please sign in to comment.