Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335810

Re: [PATCH] dmascc: Return correct error codes

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH] dmascc: Return correct error codes
Date 2016-02-16 21:40 +0100
Message-ID <r2UzF-4qz-23@gated-at.bofh.it> (permalink)
References <r0lwm-7WP-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Amitoj Kaur Chawla <amitoj1606@gmail.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@gmail.com>

Applied to net-next, thanks.

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] dmascc: Return correct error codes Amitoj Kaur Chawla <amitoj1606@gmail.com> - 2016-02-09 19:50 +0100
  Re: [PATCH] dmascc: Return correct error codes David Miller <davem@davemloft.net> - 2016-02-16 21:40 +0100

csiph-web