struct pseries_hp_work *work;
        struct pseries_hp_errorlog *hp_errlog_copy;
 
-       hp_errlog_copy = kmalloc(sizeof(struct pseries_hp_errorlog),
-                                GFP_KERNEL);
-       memcpy(hp_errlog_copy, hp_errlog, sizeof(struct pseries_hp_errorlog));
+       hp_errlog_copy = kmemdup(hp_errlog, sizeof(*hp_errlog), GFP_ATOMIC);
+       if (!hp_errlog_copy)
+               return;
 
-       work = kmalloc(sizeof(struct pseries_hp_work), GFP_KERNEL);
+       work = kmalloc(sizeof(struct pseries_hp_work), GFP_ATOMIC);
        if (work) {
                INIT_WORK((struct work_struct *)work, pseries_hp_work_fn);
                work->errlog = hp_errlog_copy;