Wouldn't it be better to return EIO since i2c_new_device()  can fail
for many reasons...


On 3/27/13, Wei Yongjun <[email protected]> wrote:
> From: Wei Yongjun <[email protected]>
>
> Fix to return a negative error code from the error handling
> case instead of 0, as returned elsewhere in this function.
>
> Signed-off-by: Wei Yongjun <[email protected]>
> ---
>  drivers/net/ethernet/intel/igb/igb_hwmon.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/intel/igb/igb_hwmon.c
> b/drivers/net/ethernet/intel/igb/igb_hwmon.c
> index 0478a1a..3b750b2 100644
> --- a/drivers/net/ethernet/intel/igb/igb_hwmon.c
> +++ b/drivers/net/ethernet/intel/igb/igb_hwmon.c
> @@ -208,6 +208,7 @@ int igb_sysfs_init(struct igb_adapter *adapter)
>       if (client == NULL) {
>               dev_info(&adapter->pdev->dev,
>                       "Failed to create new i2c device..\n");
> +             rc = -ENOMEM;
>               goto exit;
>       }
>       adapter->i2c_client = client;
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

------------------------------------------------------------------------------
Own the Future-Intel&reg; Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
E1000-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to