From: Vignesh Raghavendra Date: Mon, 17 Feb 2020 10:04:10 +0530 Subject: [PATCH] usb: dwc3: Check that the request is valid in dwc3_gadget_giveback() In-Reply-To: <1fc15d90-1eb7-7348-1f58-e3691ade50a9@denx.de> References: <20200214122328.24987-1-vigneshr@ti.com> <1fc15d90-1eb7-7348-1f58-e3691ade50a9@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 15/02/20 12:03 am, Marek Vasut wrote: > On 2/14/20 1:23 PM, Vignesh Raghavendra wrote: >> From: Jean-Jacques Hiblot >> >> This fixes potential issues reported by klokworks: >> Pointer 'req' returned from call to function 'next_request' at line 531 and >> 538 may be NULL and will be dereferenced in dwc3_gadget_giveback() > > Shouldn't you rather handle the issue in dwc3_remove_requests() ? > Also, please explain what conditions trigger this issue, i.e. when req > becomes NULL. > There is already a check for list_empty() before calling next_request() in dwc3_remove_requests() which makes sure that 'req' will not be NULL. So this report is a false positive. Please ignore the patch.. Sorry for the trouble -- Regards Vignesh