[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200226085004.GB3494@dell>
Date: Wed, 26 Feb 2020 08:50:04 +0000
From: Lee Jones <lee.jones@...aro.org>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, Oliver Neukum <oneukum@...e.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v1] mfd: dln2: Fix sanity checking for endpoints
On Tue, 18 Feb 2020, Andy Shevchenko wrote:
> While the commit 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints")
> tries to harden the sanity checks it made at the same time a regression,
> i.e. mixed in and out endpoints. Obviously it should have been not tested on
> real hardware at that time, but unluckily it didn't happen.
This is why I usually insist on defining magic numbers.
That would be a better solution I feel.
> So, fix above mentioned typo and make device being enumerated again.
>
> Fixes: 2b8bd606b1e6 ("mfd: dln2: More sanity checking for endpoints")
> Cc: Oliver Neukum <oneukum@...e.com>
> Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
> drivers/mfd/dln2.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> index 984d6b438aca..3a729b196b1f 100644
> --- a/drivers/mfd/dln2.c
> +++ b/drivers/mfd/dln2.c
> @@ -754,8 +754,8 @@ static int dln2_probe(struct usb_interface *interface,
> hostif->desc.bNumEndpoints < 2)
> return -ENODEV;
>
> - epin = &hostif->endpoint[0].desc;
> - epout = &hostif->endpoint[1].desc;
> + epin = &hostif->endpoint[1].desc;
> + epout = &hostif->endpoint[0].desc;
> if (!usb_endpoint_is_bulk_out(epout))
> return -ENODEV;
> if (!usb_endpoint_is_bulk_in(epin))
--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Powered by blists - more mailing lists