Re: [PATCH 2/3] ibmveth: Return correct error codes

2016-02-13 Thread David Miller
From: Amitoj Kaur Chawla Date: Thu, 4 Feb 2016 19:25:19 +0530 > The return value of kmalloc and kcalloc 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 two call sites only check that t

[PATCH 2/3] ibmveth: Return correct error codes

2016-02-04 Thread Amitoj Kaur Chawla
The return value of kmalloc and kcalloc 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 = \(kmalloc\|kcalloc\)(...); if@p (e == NULL) { ... return - -1 + -ENOMEM