linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: Pan Bian <bianpan201602@163.com>,
	David Dillow <dave@thedillows.org>,
	netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Pan Bian <bianpan2016@163.com>
Subject: Re: [PATCH 1/1] net: ethernet: 3com: set error code on failures
Date: Sat, 3 Dec 2016 14:53:07 +0100	[thread overview]
Message-ID: <06dd8fc8-0c39-e79d-7e34-22bfab17d8a3@gmx.de> (raw)
In-Reply-To: <1480771470-6404-1-git-send-email-bianpan201602@163.com>

Hi,

On 03.12.2016 14:24, Pan Bian wrote:
> From: Pan Bian <bianpan2016@163.com>
> 
> In function typhoon_init_one(), returns the value of variable err on
> errors. However, on some error paths, variable err is not set to a
> negative errno. This patch assigns "-EIO" to err on those paths.
> 
> Signed-off-by: Pan Bian <bianpan2016@163.com>

>  
> @@ -2409,6 +2410,7 @@ enum state_values {
>  	INIT_COMMAND_WITH_RESPONSE(&xp_cmd, TYPHOON_CMD_READ_VERSIONS);
>  	if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
>  		err_msg = "Could not get Sleep Image version";
> +		err = -EIO;
>  		goto error_out_reset;
>  	}
>  
> @@ -2451,6 +2453,7 @@ enum state_values {
>  
>  	if(register_netdev(dev) < 0) {
>  		err_msg = "unable to register netdev";
> +		err = -EIO;
>  		goto error_out_reset;
>  	}
>  
> 

Why not return the error value provided by the called functions? Is there a reason
to map different errors to -EIO?

Regards,
Lino

  reply	other threads:[~2016-12-03 13:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03 13:24 [PATCH 1/1] net: ethernet: 3com: set error code on failures Pan Bian
2016-12-03 13:53 ` Lino Sanfilippo [this message]
2016-12-03 15:23   ` Pan Bian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=06dd8fc8-0c39-e79d-7e34-22bfab17d8a3@gmx.de \
    --to=linosanfilippo@gmx.de \
    --cc=bianpan201602@163.com \
    --cc=bianpan2016@163.com \
    --cc=dave@thedillows.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).