Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc9e9cbf authored by Andrzej Hajda's avatar Andrzej Hajda Committed by Michael Ellerman
Browse files

powerpc/nvram: use kmemdup rather than duplicating its implementation

The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].

[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320



Signed-off-by: default avatarAndrzej Hajda <a.hajda@samsung.com>
Reviewed-by: default avatarNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 2e16acc5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -541,10 +541,9 @@ static ssize_t nvram_pstore_read(u64 *id, enum pstore_type_id *type,
			time->tv_sec = be64_to_cpu(oops_hdr->timestamp);
			time->tv_nsec = 0;
		}
		*buf = kmalloc(length, GFP_KERNEL);
		*buf = kmemdup(buff + hdr_size, length, GFP_KERNEL);
		if (*buf == NULL)
			return -ENOMEM;
		memcpy(*buf, buff + hdr_size, length);
		kfree(buff);

		if (err_type == ERR_TYPE_KERNEL_PANIC_GZ)