OSDN Git Service

cxl: Fix memory allocation failure test
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Sun, 30 Oct 2016 19:35:57 +0000 (20:35 +0100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 18 Nov 2016 11:41:08 +0000 (22:41 +1100)
commit5cd4f5cec2374d2c09299211d2b357cc160e49a0
treece3b26e8ff9f15d493a6e94c06e27ec55d1ce429
parent7458e8b2ce62e65051fec0bcb14cac35d4f1118d
cxl: Fix memory allocation failure test

'cxl_context_alloc()' does not return an error pointer. It is just a
shortcut for a call to 'kzalloc' with 'sizeof(struct cxl_context)' as the
size parameter.

So its return value should be compared with NULL.
While fixing it, simplify a bit the code.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
drivers/misc/cxl/api.c