diff options
author | Amitoj Kaur Chawla <amitoj1606@gmail.com> | 2016-02-04 14:55:26 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-02-13 11:57:39 +0100 |
commit | c2bb7bc5c007b7b55087eb05409edc2014f43ca8 (patch) | |
tree | aeee4608dde580375a9c3795cdf5602d1628ea3c /scripts/gcc-x86_64-has-stack-protector.sh | |
parent | net: cavium: liquidio: Return correct error code (diff) | |
download | linux-c2bb7bc5c007b7b55087eb05409edc2014f43ca8.tar.xz linux-c2bb7bc5c007b7b55087eb05409edc2014f43ca8.zip |
net: mvpp2: Return correct error codes
The return value of 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;
position p,q;
@@
e@q = kzalloc(...);
if@p (e == NULL) {
...
return
- -1
+ -ENOMEM
;
}
//</smpl>
This function may also return -1 after calling mpp2_prs_tcam_port_map_get.
So that the function consistently returns meaningful error values on
failure, the -1 is changed to -EINVAL.
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'scripts/gcc-x86_64-has-stack-protector.sh')
0 files changed, 0 insertions, 0 deletions