Re: [PATCH V5 3/9] staging: rtl8192u: check return value eprom_read

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

 



On Sat, Apr 30, 2016 at 01:53:03AM +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 | 145 +++++++++++++++++++++++----------
>  1 file changed, 103 insertions(+), 42 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> index 849a95e..6bcbdae 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -2440,9 +2440,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 < 0)
> +		return;
> +	wEPROM_ID = (u16)ret;


Think about this code.  It's completely broken now.

I'm still not going to review this patchset.

regards,
dan carpenter

_______________________________________________
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