Re: [PATCH 2/8] staging: rtl8192u: check return value eprom_read

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

 



On Thu, Apr 28, 2016 at 06:53:14PM +0100, Salah Triki wrote:
> The call of eprom_read may fail, therefore its return value must be
> checked.
> 
> Signed-off-by: Salah Triki <salah.triki@xxxxxxx>
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 147 +++++++++++++++++++++++----------
>  1 file changed, 104 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index 3a93218..1c09c61 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -2432,6 +2432,7 @@ static inline u16 endian_swap(u16 *data)
>  	*data = (tmp >> 8) | (tmp << 8);
>  	return *data;
>  }
> +

Unrelated change.

>  static void rtl8192_read_eeprom_info(struct net_device *dev)
>  {
>  	u16 wEPROM_ID = 0;
> @@ -2440,9 +2441,13 @@ static void rtl8192_read_eeprom_info(struct net_device *dev)
>  	struct r8192_priv *priv = ieee80211_priv(dev);
>  	u16 tmpValue = 0;
>  	int i;
> +	int ret;
>  
>  	RT_TRACE(COMP_EPROM, "===========>%s()\n", __func__);
> -	wEPROM_ID = eprom_read(dev, 0); /* first read EEPROM ID out; */
> +	ret = eprom_read(dev, 0); /* first read EEPROM ID out; */
> +	if (ret)
> +		return;
> +	wEPROM_ID = (u16)ret;


This is wrong and nonsense.

I'm not reviewing the rest of the patch series.

regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux