HID: logitech-hidpp: Silence intermittent get_battery_capacity errors
[linux-2.6-microblaze.git] / fs / ocfs2 / alloc.c
index d1348fc..0c335b5 100644 (file)
@@ -6191,17 +6191,17 @@ int ocfs2_begin_truncate_log_recovery(struct ocfs2_super *osb,
        if (le16_to_cpu(tl->tl_used)) {
                trace_ocfs2_truncate_log_recovery_num(le16_to_cpu(tl->tl_used));
 
-               *tl_copy = kmalloc(tl_bh->b_size, GFP_KERNEL);
+               /*
+                * Assuming the write-out below goes well, this copy will be
+                * passed back to recovery for processing.
+                */
+               *tl_copy = kmemdup(tl_bh->b_data, tl_bh->b_size, GFP_KERNEL);
                if (!(*tl_copy)) {
                        status = -ENOMEM;
                        mlog_errno(status);
                        goto bail;
                }
 
-               /* Assuming the write-out below goes well, this copy
-                * will be passed back to recovery for processing. */
-               memcpy(*tl_copy, tl_bh->b_data, tl_bh->b_size);
-
                /* All we need to do to clear the truncate log is set
                 * tl_used. */
                tl->tl_used = 0;