[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20160216.153301.170926451372426076.davem@davemloft.net>
Date: Tue, 16 Feb 2016 15:33:01 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: amitoj1606@...il.com
Cc: jreuter@...na.de, linux-hams@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
julia.lawall@...6.fr
Subject: Re: [PATCH] dmascc: Return correct error codes
From: Amitoj Kaur Chawla <amitoj1606@...il.com>
Date: Wed, 10 Feb 2016 00:12:36 +0530
> This change has been made with the goal that kernel functions should
> return something more descriptive than -1 on failure.
>
> A variable `err` has been introduced for storing error codes.
>
> The return value of kzalloc on failure should return a -1 and not a
> -ENOMEM. This was found using Coccinelle. A simplified version of
> the semantic patch used is:
...
> Furthermore, set `err` to -ENOMEM on failure of alloc_netdev(), and to
> -ENODEV on failure of register_netdev() and probe_irq_off().
>
> The single call site only checks that the return value is not 0,
> hence no change is required at the call site.
>
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@...il.com>
Applied to net-next, thanks.
Powered by blists - more mailing lists