diff options
-rw-r--r-- | drivers/block/xen-blkfront.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index c3dae2e0f290..962064487ef7 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) | |||
1203 | int j; | 1203 | int j; |
1204 | 1204 | ||
1205 | /* Stage 1: Make a safe copy of the shadow state. */ | 1205 | /* Stage 1: Make a safe copy of the shadow state. */ |
1206 | copy = kmalloc(sizeof(info->shadow), | 1206 | copy = kmemdup(info->shadow, sizeof(info->shadow), |
1207 | GFP_NOIO | __GFP_REPEAT | __GFP_HIGH); | 1207 | GFP_NOIO | __GFP_REPEAT | __GFP_HIGH); |
1208 | if (!copy) | 1208 | if (!copy) |
1209 | return -ENOMEM; | 1209 | return -ENOMEM; |
1210 | memcpy(copy, info->shadow, sizeof(info->shadow)); | ||
1211 | 1210 | ||
1212 | /* Stage 2: Set up free list. */ | 1211 | /* Stage 2: Set up free list. */ |
1213 | memset(&info->shadow, 0, sizeof(info->shadow)); | 1212 | memset(&info->shadow, 0, sizeof(info->shadow)); |