staging: goldfish: goldfish_nand: Return correct error code

The return value of devm_kzalloc on failure of allocation of memory should
be -ENOMEM and not -1.

Found using Coccinelle. A simplified version of the semantic patch
used is:

expression *e;

e = devm_kzalloc(...);
if (e == NULL) {
- -1

The single call site does not perform any checks on the return value, hence
no change is required at the call site.

Signed-off-by: Amitoj Kaur Chawla <>
Signed-off-by: Greg Kroah-Hartman <>
1 file changed