diff mbox

'LITE-ON USB2.0 DVB-T Tune' driver crash with kernel 4.13 / ubuntu 17.10

Message ID CACG2urwv1dTtEW5vuspTF5A3t2F1s-iRPZE5SiCt9o8k+k71hA@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Caumont Nov. 11, 2017, 5:53 p.m. UTC
Hi Sean,

I just realized that files in media_build/linux/driver are not
associate with a git repository. They are retrieved by the build
command.
So, I cloned the linux-stable repository to generate the patch.

Regards,
Laurent

2017-11-11 11:56 GMT+01:00 Sean Young <sean@mess.org>:
> Hi Laurent,
>
> On Fri, Nov 10, 2017 at 09:33:58PM +0100, Laurent Caumont wrote:
>> Hi Mauro,
>>
>> I could send you a patch but my git doesn't see the modification I
>> made, so it's unable to generate a patch.
>> I don't know if it's a git issue on ubunu 17.10 or if it's the way the
>> repository was created.
>
> The difference might be in the git index (or not in it). If you send a
> Signed-off-by: Laurent etc line then I'm happy to handle the patch
> generation.
>
> Thanks
>
> Sean

Comments

Sean Young Nov. 11, 2017, 6:01 p.m. UTC | #1
Hi Laurent,

On Sat, Nov 11, 2017 at 06:53:54PM +0100, Laurent Caumont wrote:
> Hi Sean,
> 
> I just realized that files in media_build/linux/driver are not
> associate with a git repository. They are retrieved by the build
> command.
> So, I cloned the linux-stable repository to generate the patch.

Great, thank you.

We need a Signed-off-by: line to accept your patch, see part 11 of

https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Thanks,

Sean
diff mbox

Patch

From 03cebd478b80677252a0f48d71d0de05e6c82740 Mon Sep 17 00:00:00 2001
From: Laurent Caumont <lcaumont2@gmail.com>
Date: Sat, 11 Nov 2017 18:44:46 +0100
Subject: [PATCH] media: dvb: i2c transfers over usb - use kmalloc instead
 stack

---
 drivers/media/usb/dvb-usb/dibusb-common.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/dvb-usb/dibusb-common.c b/drivers/media/usb/dvb-usb/dibusb-common.c
index 8207e690..e1c31381 100644
--- a/drivers/media/usb/dvb-usb/dibusb-common.c
+++ b/drivers/media/usb/dvb-usb/dibusb-common.c
@@ -223,8 +223,26 @@  EXPORT_SYMBOL(dibusb_i2c_algo);
 
 int dibusb_read_eeprom_byte(struct dvb_usb_device *d, u8 offs, u8 *val)
 {
-	u8 wbuf[1] = { offs };
-	return dibusb_i2c_msg(d, 0x50, wbuf, 1, val, 1);
+	  u8 *wbuf;
+	  u8 *rbuf;
+	  int rc;
+	  
+	  rbuf = kmalloc(1, GFP_KERNEL);
+	  if (!rbuf)
+	    return -ENOMEM;
+	 
+	  wbuf = kmalloc(1, GFP_KERNEL);
+	  if (!wbuf)
+	    return -ENOMEM;
+	  
+         *wbuf = offs;
+
+	 rc = dibusb_i2c_msg(d, 0x50, wbuf, 1, rbuf, 1);
+         kfree(wbuf);
+	 *val = *rbuf;
+	 kfree(rbuf);
+	  
+	return rc;
 }
 EXPORT_SYMBOL(dibusb_read_eeprom_byte);
 
-- 
2.14.1