Tag: c2bb7bc5c007b7b55087eb05409edc2014f43ca8

net: mvpp2: Return correct error codes

Author: Amitoj Kaur Chawla <amitoj1606@gmail.com> 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: // @@ expression *e; position p,q; @@ e@q = kzalloc(…); if@p (e == NULL) { … return – -1 + -ENOMEM …

Continue reading