mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-05 10:29:37 +00:00
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: //<smpl> @@ expression *e; @@ e = devm_kzalloc(...); if (e == NULL) { ... return - -1 + -ENOMEM ; } //</smpl> 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 <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c272dc2da1
commit
814625b539
1 changed files with 1 additions and 1 deletions
|
@ -290,7 +290,7 @@ static int nand_setup_cmd_params(struct platform_device *pdev,
|
|||
nand->cmd_params = devm_kzalloc(&pdev->dev,
|
||||
sizeof(struct cmd_params), GFP_KERNEL);
|
||||
if (!nand->cmd_params)
|
||||
return -1;
|
||||
return -ENOMEM;
|
||||
|
||||
paddr = __pa(nand->cmd_params);
|
||||
writel((u32)(paddr >> 32), base + NAND_CMD_PARAMS_ADDR_HIGH);
|
||||
|
|
Loading…
Reference in a new issue