lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Wed, 31 Jul 2013 17:22:14 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	himanshu.madhani@...gic.com
Cc:	netdev@...r.kernel.org, Dept_NX_Linux_NIC_Driver@...gic.com,
	jitendra.kalsaria@...gic.com
Subject: Re: [PATCH net-next v2 1/5] qlcnic: Return appropriate error code.

From: Himanshu Madhani <himanshu.madhani@...gic.com>
Date: Wed, 31 Jul 2013 17:10:58 -0400

> @@ -952,10 +952,11 @@ struct qlcnic_ipaddr {
>  #define QLCNIC_LB_BUCKET_SIZE	32
>  
>  /* QLCNIC Driver Error Code */
> -#define QLCNIC_FW_NOT_RESPOND		51
> +#define QLCNIC_FW_RESPONSE_TIMEOUT	51
>  #define QLCNIC_TEST_IN_PROGRESS		52
>  #define QLCNIC_UNDEFINED_ERROR		53
>  #define QLCNIC_LB_CABLE_NOT_CONN	54
> +#define QLCNIC_LB_IN_PROGRESS		55
>  #define QLCNIC_ILB_MAX_RCV_LOOP	10
>  
>  struct qlcnic_filter {
 ...
> @@ -1686,13 +1686,13 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode)
>  		if (test_bit(__QLCNIC_RESETTING, &adapter->state)) {
>  			netdev_info(netdev,
>  				    "Device is resetting, free LB test resources\n");
> -			ret = -EIO;
> +			ret = -EBUSY;
>  			goto free_diag_res;
>  		}
>  		if (loop++ > QLC_83XX_LB_WAIT_COUNT) {
>  			netdev_info(netdev,
>  				    "Firmware didn't sent link up event to loopback request\n");
> -			ret = -QLCNIC_FW_NOT_RESPOND;
> +			ret = -QLCNIC_FW_RESPONSE_TIMEOUT;
>  			qlcnic_83xx_clear_lb_mode(adapter, mode);
>  			goto free_diag_res;
>  		}

You absolutely cannot do error codes this way.

It is not valid to arbitrarily mix standard E*** error codes with
custom ones you've defined in this driver such as
QLCNIC_FW_RESPONSE_TIMEOUT.

You have no idea what values EIO, EBUSY, etc. take on. They are in fact
different on every single architecture.  So they might overlap the
values you've choosen for your custom errors.

Either you use standard error codes for everything, or your own.

I'm not applying these patches, sorry.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ