Re: [PATCH V3] staging: rtl8192u: check return value of read_nic_word_E

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 04, 2016 at 11:40:29AM +0100, Salah Triki wrote:
> The call of read_nic_word_E may fail, therefore its return value must be
> checked.
> 
> Signed-off-by: Salah Triki <salah.triki@xxxxxxx>
> ---
>  drivers/staging/rtl8192u/r8180_93cx6.c |  30 +++++--
>  drivers/staging/rtl8192u/r8180_93cx6.h |   2 +-
>  drivers/staging/rtl8192u/r8192U_core.c | 140 ++++++++++++++++++++++-----------
>  3 files changed, 119 insertions(+), 53 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c
<snip>
> @@ -144,7 +157,10 @@ u32 eprom_read(struct net_device *dev, u32 addr)
>  		 * and reading data. (eeprom outs a dummy 0)
>  		 */
>  		eprom_ck_cycle(dev);
> -		ret |= (eprom_r(dev)<<(15-i));
> +		err = eprom_r(dev)<<(15-i);

read_nic_byte_E() can return -ENOMEM so eprom_r() also can return
-ENOMEM. So if eprom_r() fails then err becomes -12 << (15-i) where i
ranges from 0 to 16.

> +		if (err)
> +			return err;

And that values is used to decide the error. oops... am i reading it
properly?

regards
sudip
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux