public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* re: [media] lmedm04: fix build
@ 2012-08-13 16:58 Dan Carpenter
  2012-08-13 18:42 ` [PATCH] " Malcolm Priestley
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-08-13 16:58 UTC (permalink / raw)
  To: mchehab; +Cc: linux-media

Hello Mauro Carvalho Chehab,

The patch db6651a9ebb3: "[media] lmedm04: fix build" from Aug 12, 
2012, leads to the following warning:
drivers/media/dvb/dvb-usb-v2/lmedm04.c:769 lme2510_download_firmware()
	 error: usb_control_msg() 'data' too small (128 vs 265)

   737          data = kzalloc(128, GFP_KERNEL);
                               ^^^
data is 128 bytes.

   738          if (!data) {
   739                  info("FRM Could not start Firmware Download"\
   740                          "(Buffer allocation failed)");
   741                  return -ENOMEM;
   742          }
   743  

[snip]

   768  
   769          usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0),
   770                          0x06, 0x80, 0x0200, 0x00, data, 0x0109, 1000);
                                                                ^^^^^^

Smatch expects this parameter to equal to sizeof(data) or smaller
instead of 265.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] re: [media] lmedm04: fix build
  2012-08-13 16:58 [media] lmedm04: fix build Dan Carpenter
@ 2012-08-13 18:42 ` Malcolm Priestley
  0 siblings, 0 replies; 2+ messages in thread
From: Malcolm Priestley @ 2012-08-13 18:42 UTC (permalink / raw)
  To: linux-media

On Mon, 2012-08-13 at 19:58 +0300, Dan Carpenter wrote:
> Hello Mauro Carvalho Chehab,
> 
> The patch db6651a9ebb3: "[media] lmedm04: fix build" from Aug 12, 
> 2012, leads to the following warning:
> drivers/media/dvb/dvb-usb-v2/lmedm04.c:769 lme2510_download_firmware()
> 	 error: usb_control_msg() 'data' too small (128 vs 265)
> 
>    737          data = kzalloc(128, GFP_KERNEL);
>                                ^^^
> data is 128 bytes.
Hi All

Control isn't used, so remove it.

Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com>

---
 drivers/media/dvb/dvb-usb-v2/lmedm04.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb-v2/lmedm04.c b/drivers/media/dvb/dvb-usb-v2/lmedm04.c
index c6bc1b8..c41d9d9 100644
--- a/drivers/media/dvb/dvb-usb-v2/lmedm04.c
+++ b/drivers/media/dvb/dvb-usb-v2/lmedm04.c
@@ -766,10 +766,6 @@ static int lme2510_download_firmware(struct dvb_usb_device *d,
 		}
 	}
 
-	usb_control_msg(d->udev, usb_rcvctrlpipe(d->udev, 0),
-			0x06, 0x80, 0x0200, 0x00, data, 0x0109, 1000);
-
-
 	data[0] = 0x8a;
 	len_in = 1;
 	msleep(2000);
-- 
1.7.9.5





^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-13 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-13 16:58 [media] lmedm04: fix build Dan Carpenter
2012-08-13 18:42 ` [PATCH] " Malcolm Priestley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox