[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Yv9LhgZgDCdA0hG8@kroah.com>
Date: Fri, 19 Aug 2022 10:36:22 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Andrey Strachuk <strochuk@...ras.ru>
Cc: Peter Chen <peter.chen@...nel.org>,
Pawel Laszczak <pawell@...ence.com>,
Roger Quadros <rogerq@...nel.org>,
Aswath Govindraju <a-govindraju@...com>,
Felipe Balbi <felipe.balbi@...ux.intel.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
ldv-project@...uxtesting.org
Subject: Re: [PATCH v2] usb: cdns3: change place of NULL check in
cdns3_gadget_ep_enable()
On Thu, Jul 28, 2022 at 07:30:14PM +0300, Andrey Strachuk wrote:
> If 'ep' is NULL, result of ep_to_cdns3_ep(ep) is invalid and
> priv_ep->cdns3_dev causes panic.
>
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
>
> Signed-off-by: Andrey Strachuk <strochuk@...ras.ru>
> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
> ---
> drivers/usb/cdns3/cdns3-gadget.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
No information on what changed from v1 to v2 :(
>
> diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
> index 5c15c48952a6..51de7457a3b8 100644
> --- a/drivers/usb/cdns3/cdns3-gadget.c
> +++ b/drivers/usb/cdns3/cdns3-gadget.c
> @@ -2284,11 +2284,14 @@ static int cdns3_gadget_ep_enable(struct usb_ep *ep,
> int ret = 0;
> int val;
>
> + if (!ep)
> + return -EINVAL;
How can ep ever be NULL at all? Why does this need to be checked?
thanks,
greg k-h
Powered by blists - more mailing lists