OSDN Git Service

powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property()
authorGen Zhang <blackgod016574@gmail.com>
Sun, 26 May 2019 02:42:40 +0000 (10:42 +0800)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 2 Jun 2019 09:39:35 +0000 (19:39 +1000)
commitefa9ace68e487ddd29c2b4d6dd23242158f1f607
tree31afde8eae3bf4cff191adcb16e2e960bf7ba775
parent3e3ebed3fef4878e6f1680ff98088db1a9688831
powerpc/pseries/dlpar: Fix a missing check in dlpar_parse_cc_property()

In dlpar_parse_cc_property(), 'prop->name' is allocated by kstrdup().
kstrdup() may return NULL, so it should be checked and handle error.
And prop should be freed if 'prop->name' is NULL.

Signed-off-by: Gen Zhang <blackgod016574@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pseries/dlpar.c