Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbcLCNxX (ORCPT ); Sat, 3 Dec 2016 08:53:23 -0500 Received: from mout.gmx.net ([212.227.15.19]:51777 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752790AbcLCNxV (ORCPT ); Sat, 3 Dec 2016 08:53:21 -0500 Subject: Re: [PATCH 1/1] net: ethernet: 3com: set error code on failures To: Pan Bian , David Dillow , netdev@vger.kernel.org References: <1480771470-6404-1-git-send-email-bianpan201602@163.com> Cc: linux-kernel@vger.kernel.org, Pan Bian From: Lino Sanfilippo Message-ID: <06dd8fc8-0c39-e79d-7e34-22bfab17d8a3@gmx.de> Date: Sat, 3 Dec 2016 14:53:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1480771470-6404-1-git-send-email-bianpan201602@163.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:VETdYgE7dlfmHagnTy1bcCOKRyBaNPPf87biSvQZd/oFV6AZNmn rttxJGzp95VzK23odJjkJQ9g+NzlfmvY8CatyjIpG0r6OTQ74Kj+p3JOCgPRCoJQ2sX8Klh kpcadrbzkpzw9bbq0+5jMDY0q5hp2bUTeFMWXDOW1xJmK03QN2kqthDOPORyTPsH8YqNqQv QhxESr8yDZR+qkd1EgcMg== X-UI-Out-Filterresults: notjunk:1;V01:K0:NCiDHXcVpVo=:L2oiXv7L8EsnqGTQHRwYnP 7OoaVIj48fEc8g2fEY4KCkvRl1mfR9fH7RDRMaOkta5FG3a21qaid/p4AFa0wbiM7O2nOKN8x D8u5dgFXMyQHPi8DXnQDMstL0PlYhOeFo9idkqksXd8Vt0lVQ4mEn0lhB80Q+EGQ1AFP2dV4c fdxW+gCEe81lrQ3JXduFFbm4vrhNrL5jzNbZuqLZHQTdtzwntiidWWCvg746gejZlmGcIURuU 1llWEK/aS5cxRG+4VMKQKo9R/dK3gT9p0RpgjJG6F9wcrWs0zGF4LITOf59RqhCY84IDd3RGg FIgUTgYWjOE868xlIAcF6Tyi+QwZFGbPnGxWlH+5VBWEhWf/6xIoFEdH/J1BwUG0Gvo/iWI0V QqtIveWpQfu4T6/BY3NoMAw2e29WljeIehHM1wyfDoTKEr5BqyCC3qovogLIdHG+8KHy22Aep 8pmKgXby7IjMF0u8oWbTWWMm/c/ZHDIFHaCg5x5Wd/fTHZHLGbFwk9R4WFc2bKHkg+hXrgGwf uLZdu0pMYnCXxPgw1j1ZR5hyRMybTaBcI4FVP7LovAgbeTtw0jaYHMQvdGosZ392NAvsoEw01 PNXwD+Ixp7eW0nNqaMH9UoQ6Y8bbBMKuL5HwWJUEpnxzYcx1Mgia5m0a0XtNL48YU8Ew8ruje IA13e1GBgHcrt37wvjY2dMRApqWlrxmoKiy5h3oMNthZbzNGviwGn3XoXnMP1V+RUeXVzt6xO 6hwNAeuUmnr/glwcMnIwb5lqeqjgKGv3CJgwZPPubFHA7hH8cp21qMR7PVLaG87bTDE7U3Vju LNLs/o7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 945 Lines: 35 Hi, On 03.12.2016 14:24, Pan Bian wrote: > From: Pan Bian > > 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 > > @@ -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