Search Linux Wireless

Re: [wireless-drivers-next:master 21/45] drivers/net/wireless/rsi/rsi_91x_usb.c:774:17-26: ERROR: id is NULL but dereferenced. (fwd)

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

 



Siva Rebbagondla <siva8118@xxxxxxxxx> writes:

> On Fri, Apr 26, 2019 at 8:28 PM Kalle Valo <kvalo@xxxxxxxxxxxxxx> wrote:
>
>> Julia Lawall <julia.lawall@xxxxxxx> writes:
>>
>> > The ifs starting on line 766 can fail because id is NULL.
>
> I don't think id will be NULL here. id is coming from probe.
> Is there any other opinions?.

The code in question:

	if (id && id->idProduct == RSI_USB_PID_9113) {
		rsi_dbg(INIT_ZONE, "%s: 9113 module detected\n", __func__);
		adapter->device_model = RSI_DEV_9113;
	} else if (id && id->idProduct == RSI_USB_PID_9116) {
		rsi_dbg(INIT_ZONE, "%s: 9116 module detected\n", __func__);
		adapter->device_model = RSI_DEV_9116;
	} else {
		rsi_dbg(ERR_ZONE, "%s: Unsupported RSI device id 0x%x\n",
			__func__, id->idProduct);
		goto err1;
	}

I think the fact that you are checking if id is NULL is confusing the
static checkers. If it's never NULL why check for that anyway? So if
it's guaranteed that id is never NULL (I didn't check that from USB
core) I would recommend to remove the NULL checks from the driver.

-- 
Kalle Valo



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux