Re: [PATCH] bonding: Return correct error code

2016-02-11 Thread David Miller
From: Amitoj Kaur Chawla Date: Sun, 7 Feb 2016 10:56:25 +0530 > 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: ... > The single call site only checks that the return

[PATCH] bonding: Return correct error code

2016-02-06 Thread Amitoj Kaur Chawla
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; @@ e = kzalloc(...); if (e == NULL) { ... return - -1 + -ENOMEM ; } // The single call site only checks t