From: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
To: xen-devel@lists.xensource.com
Cc: konrad.wilk@oracle.com, jeremy@goop.org,
virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org,
Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
Subject: [PATCH] block: replace kmalloc and then memcpy with kmemdup
Date: Mon, 11 Mar 2013 13:23:36 +0200 [thread overview]
Message-ID: <1363001016-8439-1-git-send-email-mihneadb@gmail.com> (raw)
Signed-off-by: Mihnea Dobrescu-Balaur <mihneadb@gmail.com>
---
drivers/block/xen-blkfront.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index c3dae2e..9620644 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1203,11 +1203,10 @@ static int blkif_recover(struct blkfront_info *info)
int j;
/* Stage 1: Make a safe copy of the shadow state. */
- copy = kmalloc(sizeof(info->shadow),
+ copy = kmemdup(info->shadow, sizeof(info->shadow),
GFP_NOIO | __GFP_REPEAT | __GFP_HIGH);
if (!copy)
return -ENOMEM;
- memcpy(copy, info->shadow, sizeof(info->shadow));
/* Stage 2: Set up free list. */
memset(&info->shadow, 0, sizeof(info->shadow));
--
1.7.10.4
next reply other threads:[~2013-03-11 11:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-11 11:23 Mihnea Dobrescu-Balaur [this message]
2013-03-11 14:54 ` Konrad Rzeszutek Wilk
2013-03-11 15:17 ` Daniel Baluta
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363001016-8439-1-git-send-email-mihneadb@gmail.com \
--to=mihneadb@gmail.com \
--cc=jeremy@goop.org \
--cc=konrad.wilk@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=virtualization@lists.linux-foundation.org \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®