powerpc/nvram: Fix an incorrect partition merge
authorPan Xinhui <xinhui.pan@linux.vnet.ibm.com>
Thu, 10 Dec 2015 07:30:02 +0000 (15:30 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 23 Feb 2017 03:50:50 +0000 (03:50 +0000)
commitb4f20c3454920b8305b83b24dbe84390378a5101
tree7f982c17859b2ddad269d380f6559a67b67ab358
parentc5fe093e5906fd3af9721e7cfd14a617329385c1
powerpc/nvram: Fix an incorrect partition merge

commit 11b7e154b132232535befe51c55db048069c8461 upstream.

When we merge two contiguous partitions whose signatures are marked
NVRAM_SIG_FREE, We need update prev's length and checksum, then write it
to nvram, not cur's. So lets fix this mistake now.

Also use memset instead of strncpy to set the partition's name. It's
more readable if we want to fill up with duplicate chars .

Fixes: fa2b4e54d41f ("powerpc/nvram: Improve partition removal")
Signed-off-by: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/powerpc/kernel/nvram_64.c