diff mbox series

HID: ft260: fix an error message in ft260_i2c_write_read()

Message ID YFMt5pml1voGQkUy@mwanda (mailing list archive)
State Mainlined
Commit 2076b7bdc5290141cea809c8462b769836bd2757
Delegated to: Jiri Kosina
Headers show
Series HID: ft260: fix an error message in ft260_i2c_write_read() | expand

Commit Message

Dan Carpenter March 18, 2021, 10:39 a.m. UTC
The "len" variable is uninitialize.

Fixes: 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/hid/hid-ft260.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jiri Kosina March 19, 2021, 1:26 p.m. UTC | #1
On Thu, 18 Mar 2021, Dan Carpenter wrote:

> The "len" variable is uninitialize.
> 
> Fixes: 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  drivers/hid/hid-ft260.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
> index 047aa85a7c83..a5751607ce24 100644
> --- a/drivers/hid/hid-ft260.c
> +++ b/drivers/hid/hid-ft260.c
> @@ -512,7 +512,8 @@ static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs)
>  	struct hid_device *hdev = dev->hdev;
>  
>  	if (msgs[0].len > 2) {
> -		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__, len);
> +		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__,
> +			msgs[0].len);
>  		return -EOPNOTSUPP;
>  	}

Applied, thanks Dan.
Michael Zaidman March 19, 2021, 4:56 p.m. UTC | #2
On Fri, Mar 19, 2021 at 02:26:43PM +0100, Jiri Kosina wrote:
> On Thu, 18 Mar 2021, Dan Carpenter wrote:
> 
> > The "len" variable is uninitialize.
> > 
> > Fixes: 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >  drivers/hid/hid-ft260.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
> > index 047aa85a7c83..a5751607ce24 100644
> > --- a/drivers/hid/hid-ft260.c
> > +++ b/drivers/hid/hid-ft260.c
> > @@ -512,7 +512,8 @@ static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs)
> >  	struct hid_device *hdev = dev->hdev;
> >  
> >  	if (msgs[0].len > 2) {
> > -		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__, len);
> > +		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__,
> > +			msgs[0].len);
> >  		return -EOPNOTSUPP;
> >  	}

Dan, thanks for that quick fix.

> Applied, thanks Dan.
> -- 
> Jiri Kosina

Jiri, thank you for applying it.
diff mbox series

Patch

diff --git a/drivers/hid/hid-ft260.c b/drivers/hid/hid-ft260.c
index 047aa85a7c83..a5751607ce24 100644
--- a/drivers/hid/hid-ft260.c
+++ b/drivers/hid/hid-ft260.c
@@ -512,7 +512,8 @@  static int ft260_i2c_write_read(struct ft260_device *dev, struct i2c_msg *msgs)
 	struct hid_device *hdev = dev->hdev;
 
 	if (msgs[0].len > 2) {
-		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__, len);
+		hid_err(hdev, "%s: unsupported wr len: %d\n", __func__,
+			msgs[0].len);
 		return -EOPNOTSUPP;
 	}